Ticket #15081: 15081.diff
File 15081.diff, 1.3 KB (added by , 12 years ago) |
---|
-
wp-includes/general-template.php
147 147 * 148 148 * @since 2.7.0 149 149 * @param boolean $echo Default to echo and not return the form. 150 * @param string $format What type to use for the search field. If set to 'html5' it changes to type="search". 150 151 * @return string|null String when retrieving, null when displaying or if searchform.php exists. 151 152 */ 152 function get_search_form( $echo = true) {153 function get_search_form( $echo = true, $format = 'xhtml' ) { 153 154 do_action( 'get_search_form' ); 154 155 155 156 $search_form_template = locate_template('searchform.php'); … … 158 159 return; 159 160 } 160 161 162 $type = ( 'html5' == strtolower( $format ) ) ? 'search' : 'text'; 163 161 164 $form = '<form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '" > 162 165 <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label> 163 <input type=" text" value="' . get_search_query() . '" name="s" id="s" />166 <input type="' . $type . '" value="' . get_search_query() . '" name="s" id="s" /> 164 167 <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" /> 165 168 </div> 166 169 </form>';