Ticket #14851: 14851.2.patch
File 14851.2.patch, 1.2 KB (added by , 12 years ago) |
---|
-
wp-includes/general-template.php
146 146 * search. To give a few examples of what it can be used for. 147 147 * 148 148 * @since 2.7.0 149 * @param boolean $echo Default to echo and not return the form.149 * @param boolean|string $echo Default to echo and not return the form or if string returns the specialised searchform 150 150 * @param string $format Which type to use for the search field. If set to 'html5' it changes to search input type and adds placeholder text. 151 151 * @return string|null String when retrieving, null when displaying or if searchform.php exists. 152 152 */ 153 153 function get_search_form( $echo = true, $format = 'xhtml' ) { 154 154 do_action( 'get_search_form' ); 155 155 156 $search_form_template = locate_template( 'searchform.php' ); 156 $templates = array(); 157 $name = $echo; 158 if ( is_string( $name ) ) { 159 $templates[] = "searchform-{$name}.php"; 160 $echo = false; 161 } 162 $templates[] = 'searchform.php'; 163 $search_form_template = locate_template( $templates ); 157 164 if ( '' != $search_form_template ) { 158 165 ob_start(); 159 166 require( $search_form_template );