search_form_format WordPress Filter Hook

The search_form_format hook allows you to modify the default search form HTML output. This can be useful if you want to add custom classes or attributes to the form element.

apply_filters( 'search_form_format', string $format, array $args ) #

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.


Top ↑

More Information

The filter function must return a $format value after it is finished processing or the search form will be empty.


Top ↑

Source

File: wp-includes/general-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.5.0The $args parameter was added.
3.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More