wp-includes/general-template.php | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index 89ebaeb..aa248dc 100644
a
|
b
|
function get_search_form( $echo = true, $format = 'xhtml' ) { |
159 | 159 | require( $search_form_template ); |
160 | 160 | $form = ob_get_clean(); |
161 | 161 | } else { |
162 | | $type = ( 'html5' === $format ) ? 'search' : 'text'; |
163 | | $placeholder = ( 'html5' === $format ) ? 'placeholder="' . esc_attr_x( 'Search …', 'placeholder' ) . '" ' : ''; |
164 | | |
165 | | $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '"> |
166 | | <div> |
167 | | <label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label> |
168 | | <input type="' . $type . '" ' . $placeholder . 'value="' . get_search_query() . '" name="s" id="s" /> |
169 | | <input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" /> |
170 | | </div> |
171 | | </form>'; |
| 162 | if ( 'html5' == $format ) { |
| 163 | $form = '<form role="search" method="get" class="searchform" action="' . esc_url( home_url( '/' ) ) . '"> |
| 164 | <div> |
| 165 | <label class="screen-reader-text">' . _x( 'Search for:', 'label' ) . ' |
| 166 | <input type="search" placeholder="' . esc_attr_x( 'Search …', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" /> |
| 167 | </label> |
| 168 | <input type="submit" class="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" /> |
| 169 | </div> |
| 170 | </form>'; |
| 171 | } else { |
| 172 | $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '"> |
| 173 | <div> |
| 174 | <label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label> |
| 175 | <input type="text" value="' . get_search_query() . '" name="s" id="s" /> |
| 176 | <input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" /> |
| 177 | </div> |
| 178 | </form>'; |
| 179 | } |
172 | 180 | } |
173 | 181 | |
174 | 182 | if ( $echo ) |