admin管理员组文章数量:1134081
I'm trying to minimally hook (via a plugin) into the search form generated by the default search block and add a target="_blank"
to open the results in a new tab. I'd much prefer to do this via PHP and not JavaScript. The get_search_form
filter and outright overriding a piece of the template won't necessarily work because I can't assume the search experience hasn't been edited, only that the default core search block is being used and that it has some kind of search form. Is there some obvious use of has_block
or get_block_template
or some other newer function that I'm overlooking?
I'm trying to minimally hook (via a plugin) into the search form generated by the default search block and add a target="_blank"
to open the results in a new tab. I'd much prefer to do this via PHP and not JavaScript. The get_search_form
filter and outright overriding a piece of the template won't necessarily work because I can't assume the search experience hasn't been edited, only that the default core search block is being used and that it has some kind of search form. Is there some obvious use of has_block
or get_block_template
or some other newer function that I'm overlooking?
1 Answer
Reset to default 0The render_block filter might provide a solution. I say 'might' because i have not tested and the search "form" element may not be accessible via the filter.
Wordpress Render Block filter
本文标签: Adding attributes to the core search block form
版权声明:本文标题:Adding attributes to the core search block form 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736751197a1951047.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论