函数原型
get_search_form( array $args = array() ): void|string
函数描述
Displays search form.
是否弃用
未弃用
函数参数
-
$args
array
Optional - Array of display arguments.
echoboolWhether to echo or return the form. Default true.aria_labelstringARIA label for the search form. Useful to distinguish multiple search forms on the same page and improve accessibility.
Default:
array()
函数返回值
void|string Void if 'echo' argument is true, search form HTML if 'echo' is false.
函数位置
File: wp-includes/general-template.php.
函数源码
get_search_form( $echo );源码链接
变更日志
| Version | Description |
|---|---|
| 5.2.0 | The $args array parameter was added in place of an $echo boolean flag. |
| 2.7.0 | Introduced. |

