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?
Add a comment
|
1 Answer
The 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.