Filter: bricks/search_form/home_url
The bricks/search_form/home_url filter allows developers to customize the action URL of the search form within the Bricks theme. This filter provides the flexibility to redirect search queries to a different URL than the default WordPress home URL.
By using this filter, developers can integrate custom search solutions or direct the search form submissions to a specific page, enhancing the search functionality tailored to specific needs.
Example Usage:
Section titled “Example Usage:”<code>add_filter( 'bricks/search_form/home_url', function( $home_url ) {</code><code> // Custom logic to determine the action URL</code><code> $custom_action_url = 'https://example.com/custom-search-page/'; </code><code> return $custom_action_url;</code><code>});</code>In this simple example, the search form action URL is changed to a custom page. This is particularly useful for websites with specialized search requirements or for integrating with external search platforms.
Parameters:
Section titled “Parameters:”$home_url(string): The default URL to which the search form points, typically the home URL.
Return:
Section titled “Return:”- (string): The modified URL for the search form action.
Was this helpful?
A quick vote and short notes help us improve these docs faster.
Leave a note for us
Please do not include passwords, license keys, or personal data. We store submitted notes to improve the docs.
Thanks for sharing feedback. We're using it to improve these docs.