the_search_query
Filters the contents of the search query variable, for display.
Использование
add_filter( 'the_search_query', 'wp_kama_the_search_query_filter' );
/**
* Function for `the_search_query` filter-hook.
*
* @param mixed $search Contents of the search query variable.
*
* @return mixed
*/
function wp_kama_the_search_query_filter( $search ){
// filter...
return $search;
}
- $search(разное)
- Contents of the search query variable.
Список изменений
| С версии 2.3.0 | Введена. |
Где вызывается хук
the_search_query
wp-includes/general-template.php 4502
echo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) );