the_search_query
Filter HookDescription
Filters the contents of the search query variable, for display.Hook Information
File Location |
wp-includes/general-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 4488 |
Hook Parameters
Type | Name | Description |
---|---|---|
mixed
|
$search
|
Contents of the search query variable. |
Usage Examples
Basic Usage
<?php
// Hook into the_search_query
add_filter('the_search_query', 'my_custom_filter', 10, 1);
function my_custom_filter($search) {
// Your custom filtering logic here
return $search;
}
Source Code Context
wp-includes/general-template.php:4488
- How this hook is used in WordPress core
<?php
4483 *
4484 * @since 2.3.0
4485 *
4486 * @param mixed $search Contents of the search query variable.
4487 */
4488 echo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) );
4489 }
4490
4491 /**
4492 * Gets the language attributes for the 'html' tag.
4493 *
PHP Documentation
<?php
/**
* Filters the contents of the search query variable, for display.
*
* @since 2.3.0
*
* @param mixed $search Contents of the search query variable.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/general-template.php
Related Hooks
Related hooks will be displayed here in future updates.