pre_get_search_form
Fires before the search form is retrieved, at the start of get_search_form().
Usage
add_action( 'pre_get_search_form', 'wp_kama_pre_get_search_form_action' );
/**
* Function for `pre_get_search_form` action-hook.
*
* @param array $args The array of arguments for building the search form. See get_search_form() for information on accepted arguments.
*
* @return void
*/
function wp_kama_pre_get_search_form_action( $args ){
// action...
}
- $args(array)
- The array of arguments for building the search form. See get_search_form() for information on accepted arguments.
Changelog
| Since 3.6.0 | Introduced. |
| Since 2.7.0 | as get_search_form |
| Since 5.5.0 | The $args parameter was added. |
Where the hook is called
wp-includes/general-template.php 254
do_action( 'pre_get_search_form', $args );