WordPress at a glance

the_search_query() WP 1.0

Displays the contents of the search query variable.

The search query string is passed through esc_attr() to ensure that it is safe for placing in an html attribute.

Works based on: get_search_query()
✈ 1 time = 0.000017s = very fast | 50000 times = 0.04s = speed of light PHP 7.1.2, WP 4.7.3
Hooks from function:
Return

Nothing (null).

Usage

the_search_query();

Code of the_search_query: wp-includes/general-template.php VER 4.9.8

<?php
function the_search_query() {
	/**
	 * Filters the contents of the search query variable for display.
	 *
	 * @since 2.3.0
	 *
	 * @param mixed $search Contents of the search query variable.
	 */
	echo esc_attr( apply_filters( 'the_search_query', get_search_query( false ) ) );
}

Related Functions

From category: Other Theme Functions

More from Template Tags: Posts, Pages, ...

No comments
    Hello, !     Log In . Register