WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
151 | * |
152 | * @since 2.7.0 |
153 | * @uses apply_filters() Calls 'search_form_format' filter to determine which type to use for the search field. |
154 | * If set to 'html5', it changes to search input type and adds placeholder text. |
155 | * |
156 | * @param boolean $echo Default to echo and not return the form. |
157 | * @return string|null String when retrieving, null when displaying or if searchform.php exists. |
158 | */ |
159 | function get_search_form( $echo = true ) { |
160 | do_action( 'pre_get_search_form' ); |
161 |
|
162 | $format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml'; |
163 | $format = apply_filters( 'search_form_format', $format ); |
164 |
|
165 | $search_form_template = locate_template( 'searchform.php' ); |
166 | if ( '' != $search_form_template ) { |
167 | ob_start(); |
168 | require( $search_form_template ); |
169 | $form = ob_get_clean(); |