Improve the HTML classes for the new html5 format in get_search_form().

Update Twenty Thirteen to reflect the changes.

props obenland.
fixes #23850.



git-svn-id: http://core.svn.wordpress.org/trunk@24524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-06-27 20:45:12 +00:00
parent 68ec768ba3
commit ff6dd2b952
2 changed files with 10 additions and 16 deletions

View File

@ -916,14 +916,13 @@ ul.nav-menu li:hover > ul,
width: 100%; width: 100%;
} }
.site-header .searchform { .site-header .search-form {
position: absolute; position: absolute;
right: 20px; right: 20px;
top: 1px; top: 1px;
} }
.site-header .searchform [type="search"], .site-header .search-field {
.site-header .searchform [type="text"] {
background-color: transparent; background-color: transparent;
background-image: url(images/search-icon.png); background-image: url(images/search-icon.png);
background-position: 5px center; background-position: 5px center;
@ -940,8 +939,7 @@ ul.nav-menu li:hover > ul,
width: 0; width: 0;
} }
.site-header .searchform [type="search"]:focus, .site-header .search-field:focus {
.site-header .searchform [type="text"]:focus {
background-color: #fff; background-color: #fff;
border: 2px solid #c3c0ab; border: 2px solid #c3c0ab;
cursor: text; cursor: text;
@ -2520,14 +2518,10 @@ footer.entry-meta {
} }
/* Search widget */ /* Search widget */
.searchform [type="submit"] { .search-form .search-submit {
display: none; display: none;
} }
.widget .searchform [type="text"] {
width: 100%;
}
/* RSS Widget */ /* RSS Widget */
.widget_rss .rss-date { .widget_rss .rss-date {
display: block; display: block;
@ -3098,8 +3092,7 @@ footer.entry-meta {
(-webkit-min-device-pixel-ratio: 1.25), (-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 120dpi) { (min-resolution: 120dpi) {
.site-header .searchform [type="search"], .site-header .search-field {
.site-header .searchform [type="text"] {
background-image: url(images/search-icon-2x.png); background-image: url(images/search-icon-2x.png);
} }

View File

@ -165,11 +165,12 @@ function get_search_form( $echo = true ) {
$form = ob_get_clean(); $form = ob_get_clean();
} else { } else {
if ( 'html5' == $format ) { if ( 'html5' == $format ) {
$form = '<form role="search" method="get" class="searchform" action="' . esc_url( home_url( '/' ) ) . '"> $form = '<form role="search" method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '">
<label><span class="screen-reader-text">' . _x( 'Search for:', 'label' ) . '</span> <label>
<input type="search" placeholder="' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" title="' . _x( 'Search for:', 'label' ) . '" /> <span class="screen-reader-text">' . _x( 'Search for:', 'label' ) . '</span>
<input type="search" class="search-field" placeholder="' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" title="' . _x( 'Search for:', 'label' ) . '" />
</label> </label>
<input type="submit" class="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" /> <input type="submit" class="search-submit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
</form>'; </form>';
} else { } else {
$form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '"> $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '">