WordPress函数:the_search_query

一、函数简介

显示搜索查询变量的内容。(Displays the contents of the search query variable.)  

二、函数参数

   

三、函数案例

<?php the_search_query() ?>
     

四、源代码

/**
 * 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 ) ) );
}
     
THE END