the_search_query

Displays the contents of the search query variable.

Description

the_search_query(); 

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


Usage

  1. if ( !function_exists( 'the_search_query' ) ) { 
  2. require_once ABSPATH . WPINC . '/general-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = the_search_query(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/general-template.php  
  1. function the_search_query() { 
  2. /** 
  3. * Filters the contents of the search query variable for display. 
  4. * @since 2.3.0 
  5. * @param mixed $search Contents of the search query variable. 
  6. */