W3cubDocs

/WordPress

do_action( ‘pre_get_search_form’, array $args )

Fires before the search form is retrieved, at the start of get_search_form() .

Parameters

$argsarray
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 bool
    Whether to echo or return the form. Default true.
  • aria_label string
    ARIA label for the search form. Useful to distinguish multiple search forms on the same page and improve accessibility.

Source

do_action( 'pre_get_search_form', $args );

Changelog

Version Description
5.5.0 The $args parameter was added.
3.6.0
2.7.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/pre_get_search_form