Make WordPress Core

Ticket #23850: 23850-search-form-classes.patch

File 23850-search-form-classes.patch, 2.8 KB (added by obenland, 12 years ago)

Adds .search-field class and hyphenates other classes in html5 output

  • wp-content/themes/twentythirteen/style.css

     
    937937        width: 100%;
    938938}
    939939
    940 .site-header .searchform {
     940.site-header .search-form {
    941941        position: absolute;
    942942        right: 20px;
    943943        top: 1px;
    944944}
    945945
    946 .site-header .searchform [type="search"],
    947 .site-header .searchform [type="text"] {
     946.site-header .search-field {
    948947        background-color: transparent;
    949948        background-image: url(images/search-icon.png);
    950949        background-position: 5px center;
     
    961960        width: 0;
    962961}
    963962
    964 .site-header .searchform [type="search"]:focus,
    965 .site-header .searchform [type="text"]:focus {
     963.site-header .search-field:focus {
    966964        background-color: #fff;
    967965        border: 2px solid #c3c0ab;
    968966        cursor: text;
     
    25412539}
    25422540
    25432541/* Search widget */
    2544 .searchform [type="submit"] {
     2542.search-form .search-submit {
    25452543        display: none;
    25462544}
    25472545
    2548 .widget .searchform [type="text"] {
    2549         width: 100%;
    2550 }
    2551 
    25522546/* RSS Widget */
    25532547.widget_rss .rss-date {
    25542548        display: block;
     
    31213115        (-webkit-min-device-pixel-ratio: 1.25),
    31223116        (min-resolution: 120dpi) {
    31233117
    3124         .site-header .searchform [type="search"],
    3125         .site-header .searchform [type="text"] {
     3118        .site-header .search-field {
    31263119                background-image: url(images/search-icon-2x.png);
    31273120        }
    31283121
  • wp-includes/general-template.php

     
    165165                $form = ob_get_clean();
    166166        } else {
    167167                if ( 'html5' == $format ) {
    168                         $form = '<form role="search" method="get" class="searchform" action="' . esc_url( home_url( '/' ) ) . '">
    169                                 <label><span class="screen-reader-text">' . _x( 'Search for:', 'label' ) . '</span>
    170                                         <input type="search" placeholder="' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" title="' . _x( 'Search for:', 'label' ) . '" />
     168                        $form = '<form role="search" method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '">
     169                                <label>
     170                                        <span class="screen-reader-text">' . _x( 'Search for:', 'label' ) . '</span>
     171                                        <input type="search" class="search-field" placeholder="' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" title="' . _x( 'Search for:', 'label' ) . '" />
    171172                                </label>
    172                                 <input type="submit" class="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
     173                                <input type="submit" class="search-submit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
    173174                        </form>';
    174175                } else {
    175176                        $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '">