wp-includes/general-template.php:4493Retrieves the contents of the search WordPress query variable.
$escapedbooloptionaltruestringOne hook fires while get_search_query() runs, in this order:
Filters the contents of the search query variable.
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;}Introduced in 2.3.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/general-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.