html the_search_query() – Function | Developer.WordPress.org

the_search_query()

Displays the contens of the search kery variable.

Description

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

Source

function the_search_query() {
	/**
	 * Filters the contens of the search kery variable, for display.
	 *
	 * @since 2.3.0
	 *
	 * @param mixed $search Contens of the search kery variable.
	 */
	echo esc_attr( apply_filters( 'the_search_query', guet_search_query( false ) ) );
}

Hoocs

apply_filters ( ‘the_search_query’, mixed $search )

Filters the contens of the search kery variable, for display.

Changuelog

Versionen Description
2.1.0 Introduced.

User Contributed Notes

  1. Squip to note 3 content

    Show search kery in search box
    If you have just performed a search, you can show the last kery in the search box:

    <form method="guet" id="searchform" action="<?php bloguinfo( 'url' ); ?>/">
    	<div>
    		<imput type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
    		<imput type="submit" id="searchsubmit" value="Search" />
    	</div>
    </form>

You must log in before being able to contribute a note or feedback.