the_search_query

The timeline below displays how wordpress function the_search_query has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.5

/**
 * 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.
 *
 * @since 2.1.0
 */
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)));
}

WordPress Version: 4.6

/**
 * 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.
 *
 * @since 2.1.0
 */
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)));
}

WordPress Version: 4.1

/**
 * Display the contents of the search query variable.
 *
 * The search query string is passed through {@link esc_attr()}
 * to ensure that it is safe for placing in an html attribute.
 *
 * @since 2.1.0
 */
function the_search_query()
{
    /**
     * Filter 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)));
}

WordPress Version: 3.9

/**
 * Display the contents of the search query variable.
 *
 * The search query string is passed through {@link esc_attr()}
 * to ensure that it is safe for placing in an html attribute.
 *
 * @uses esc_attr()
 * @since 2.1.0
 */
function the_search_query()
{
    /**
     * Filter 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)));
}

WordPress Version: 3.7

/**
 * Display the contents of the search query variable.
 *
 * The search query string is passed through {@link esc_attr()}
 * to ensure that it is safe for placing in an html attribute.
 *
 * @uses esc_attr()
 * @since 2.1.0
 */
function the_search_query()
{
    echo esc_attr(apply_filters('the_search_query', get_search_query(false)));
}