get_search_query( bool $escaped = true )

检索搜索WordPress查询变量的内容。

描述

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

参数

$escaped
(bool) (Optional) Whether the result is escaped. Only use when you are later escaping it. Do not use unescaped.

Default value: true

get_search_query()通常与get_search_form()一起使用。

分享到: