search_form_args

過濾鉤子
apply_filters( 'search_form_args', $args )
引數
  • (array) $args The array of arguments for building the search form. See get_search_form() for information on accepted arguments.
    Required:
定義位置
相關勾子
search_form_formatget_search_formuser_new_form_tagterm_search_min_charsuser_edit_form_tag
相關方法
get_search_forminstall_search_formextract_from_markerssize_format_search_terms_tidytype_url_form_image
引入
5.2.0
棄用
-

search_form_args: 這是WordPress中的一個過濾器鉤子,允許開發者修改傳遞給get_search_form函式的引數。search_form_args鉤子將搜尋表單的引數作為一個引數傳遞,鉤子函式可以返回一個修改後的引數集來代替使用。這對於改變搜尋表單的預設行為或向表單新增自定義選項很有用。

過濾生成搜尋表單時使用的引數陣列。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$args = apply_filters( 'search_form_args', $args );
$args = apply_filters( 'search_form_args', $args );
$args = apply_filters( 'search_form_args', $args );

常見問題

FAQs
檢視更多 >