search_form_format

過濾鉤子
apply_filters( 'search_form_format', $format, $args )
引數
  • (string) $format The type of markup to use in the search form. Accepts 'html5', 'xhtml'.
    Required:
  • (array) $args The array of arguments for building the search form. See get_search_form() for information on accepted arguments.
    Required:
定義位置
相關勾子
search_form_argsget_search_formpostmeta_form_limitpre_get_search_formuser_new_form_tag
相關方法
get_search_formset_post_formatsize_formathas_post_formatget_post_format_search_terms_tidy
引入
5.5.0
棄用
-

search_form_format: 這是WordPress中的一個過濾鉤子,允許開發者修改用於顯示搜尋表單的HTML程式碼。search_form_format鉤子將搜尋表單的HTML程式碼作為一個引數傳遞,鉤子函式可以返回一組修改後的HTML程式碼來代替。這對於改變搜尋表單的外觀和感覺或向表單新增自定義元素很有用。

過濾搜尋表格的HTML格式。

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

常見問題

FAQs
檢視更多 >