get_search_query
Filters the contents of the search query variable.
Usage
add_filter( 'get_search_query', 'wp_kama_get_search_query_filter' );
/**
* Function for `get_search_query` filter-hook.
*
* @param mixed $search Contents of the search query variable.
*
* @return mixed
*/
function wp_kama_get_search_query_filter( $search ){
// filter...
return $search;
}
- $search(mixed)
- Contents of the search query variable.
Changelog
| Since 2.3.0 | Introduced. |
Where the hook is called
get_search_query
wp-includes/general-template.php 4501
$query = apply_filters( 'get_search_query', get_query_var( 's' ) );