You appear to be a bot. Output may be restricted
Description
Retrieves the contents of the search WordPress query variable.
The search query string is passed through esc_attr() to ensure that it is safe for placing in an HTML attribute.
Usage
$string = get_search_query( $escaped );
Parameters
- $escaped
- ( bool ) optional default: 1 – Whether the result is escaped. Default true. Only use when you are later escaping it. Do not use unescaped.
Returns
string
Source
File name: wordpress/wp-includes/general-template.php
Lines:
1 to 15 of 15
function get_search_query( $escaped = true ) { /** * Filters the contents of the search query variable. * * @since 2.3.0 * * @param mixed $search Contents of the search query variable. */ $query = apply_filters( 'get_search_query', get_query_var( 's' ) ); if ( $escaped ) { $query = esc_attr( $query ); } return $query; }