Search block submission URL can't be customized #35572
Labels
[Block] Search
Affects the Search Block - used to display a search field
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
The search block always submits to
home_url( '/' )
, but I'd like to submit to a custom URL.In my use case, I'm building a header that will be used across all sites in a Multisite network. I want searches to go to a custom page that searches across all of the sites (example).
I want to preserve the ability to search a single site, though, so I'm not overriding WP's normal search behavior.
render_block_core_search()
doesn't provide any filters or block attributes that can be used to change the form'saction
, though.Related: #35260, #22071
What is your proposed solution?
I thought of two options:
<!-- wp:search {"formActionUrl":"https://wordpress.org/search/do-search.php" ... /-->
render_block_core_search()
I'd lean towards the attribute, but don't feel strongly. They're not mutually exclusive, either.
The text was updated successfully, but these errors were encountered: