Filters the HTML format of the search form.
Parameters
$format
string- The type of markup to use in the search form.
Accepts'html5'
,'xhtml'
. $args
array- The array of arguments for building the search form.
See get_search_form() for information on accepted arguments.More Arguments from get_search_form( … $args )
Array of display arguments.
echo
boolWhether to echo or return the form. Default true.aria_label
stringARIA label for the search form. Useful to distinguish multiple search forms on the same page and improve accessibility.
Source
$format = apply_filters( 'search_form_format', $format, $args );
Example migrated from Codex:
Switching the search form format to
html5