显示搜索查询变量的内容。
原型
the_search_query()
描述
搜索查询字符串通过esc_attr()传递,以确保放置在html属性中是安全的。
源文件
路径:wp-includes/general-template.php
<?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 ) ) );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/the_search_query/