WordPress.org

Make WordPress Core

Ticket #23868: 23868-4.patch

File 23868-4.patch, 5.2 KB (added by WraithKenny, 5 years ago)
  • wp-content/themes/twentyeleven/searchform.php

     
    66 * @subpackage Twenty_Eleven
    77 * @since Twenty Eleven 1.0
    88 */
     9
     10// Compat for WP < 3.6
     11if ( ! isset( $search_form_counter ) ) {
     12        static $search_form_counter = -1;
     13        $search_form_counter++;
     14        $form_id   = $search_form_counter ? '' : ' id="searchform"';
     15        $submit_id = $search_form_counter ? '' : ' id="searchsubmit"';
     16        $text_id   = $search_form_counter ? 's-' . $search_form_counter : 's';
     17}
    918?>
    10         <form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
    11                 <label for="s" class="assistive-text"><?php _e( 'Search', 'twentyeleven' ); ?></label>
    12                 <input type="text" class="field" name="s" id="s" placeholder="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" />
    13                 <input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" />
     19        <form method="get"<?php echo $form_id; ?> class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
     20                <label for="<?php echo $text_id; ?>" class="assistive-text"><?php _e( 'Search', 'twentyeleven' ); ?></label>
     21                <input type="text" class="field" name="s" id="<?php echo $text_id; ?>" placeholder="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" />
     22                <input type="submit" class="submit" name="submit"<?php echo $submit_id; ?> value="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" />
    1423        </form>
  • wp-content/themes/twentyeleven/style.css

     
    279279        width: auto;
    280280}
    281281/* Make sure the logo and search form don't collide */
    282 .one-column #branding #searchform {
     282.one-column #branding .searchform {
    283283        right: 40px;
    284284        top: 4em;
    285285}
     
    468468input[type=number] {
    469469        padding: 3px;
    470470}
    471 input#s {
     471.searchform input.field {
    472472        background: url(images/search.png) no-repeat 5px 6px;
    473473        -moz-border-radius: 2px;
    474474        border-radius: 2px;
     
    477477        line-height: 1.2em;
    478478        padding: 4px 10px 4px 28px;
    479479}
    480 input#searchsubmit {
     480.searchform input.submit {
    481481        display: none;
    482482}
    483483
     
    636636}
    637637
    638638/* Search Form */
    639 #branding #searchform {
     639#branding .searchform {
    640640        position: absolute;
    641641        top: 3.8em;
    642642        right: 7.6%;
    643643        text-align: right;
    644644}
    645 #branding #searchform div {
     645#branding .searchform div {
    646646        margin: 0;
    647647}
    648 #branding #s {
     648#branding .searchform .field {
    649649        float: right;
    650650        -webkit-transition-duration: 400ms;
    651651        -webkit-transition-property: width, background;
     
    658658        -o-transition-timing-function: ease;
    659659        width: 72px;
    660660}
    661 #branding #s:focus {
     661#branding .searchform .field:focus {
    662662        background-color: #f9f9f9;
    663663        width: 196px;
    664664}
    665 #branding #searchsubmit {
     665#branding .searchform .submit {
    666666        display: none;
    667667}
    668 #branding .only-search #searchform {
     668#branding .only-search .searchform {
    669669        top: 5px;
    670670        z-index: 1;
    671671}
    672 #branding .only-search #s {
     672#branding .only-search .searchform .field {
    673673        background-color: #666;
    674674        border-color: #000;
    675675        color: #222;
    676676}
    677 #branding .only-search #s,
    678 #branding .only-search #s:focus {
     677#branding .only-search .searchform .field,
     678#branding .only-search .searchform .field:focus {
    679679        width: 85%;
    680680}
    681 #branding .only-search #s:focus {
     681#branding .only-search .searchform .field:focus {
    682682        background-color: #bbb;
    683683}
    684 #branding .with-image #searchform {
     684#branding .with-image .searchform {
    685685        top: auto;
    686686        bottom: -27px;
    687687        max-width: 195px;
     
    803803        border-top: 1px solid #ddd;
    804804        padding: 6px 10px 6px 0;
    805805}
    806 .entry-content #s {
     806.entry-content .searchform .field {
    807807        width: 75%;
    808808}
    809809.comment-content ul,
     
    13221322/* =error404
    13231323----------------------------------------------- */
    13241324
    1325 .error404 #main #searchform {
     1325.error404 #main .searchform {
    13261326        background: #f9f9f9;
    13271327        border: 1px solid #ddd;
    13281328        border-width: 1px 0;
     
    13301330        overflow: hidden;
    13311331        padding: 1.625em 8.9%;
    13321332}
    1333 .error404 #main #s {
     1333.error404 #main .searchform .field {
    13341334        width: 95%;
    13351335}
    13361336.error404 #main .widget {
     
    18091809.widget_search form {
    18101810        margin: 0 0 1.625em;
    18111811}
    1812 .widget_search #s {
     1812.widget_search .searchform .field {
    18131813        width: 77%;
    18141814}
    1815 .widget_search #searchsubmit {
     1815.widget_search .searchform .submit {
    18161816        background: #ddd;
    18171817        border: 1px solid #ccc;
    18181818        -webkit-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
     
    18241824        position: relative;
    18251825        top: -2px;
    18261826}
    1827 .widget_search #searchsubmit:active {
     1827.widget_search .searchform .submit:active {
    18281828        background: #1982d1;
    18291829        border-color: #0861a5;
    18301830        -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
     
    24402440                margin-right: 0;
    24412441        }
    24422442        /* Make sure the logo and search form don't collide */
    2443         #branding #searchform {
     2443        #branding .searchform {
    24442444                top: 1.625em !important;
    24452445        }
    24462446        /* Floated content doesn't work well at this size */
     
    25552555        #site-description {
    25562556                font-size: 10pt;
    25572557        }
    2558         #branding #searchform {
     2558        #branding .searchform {
    25592559                display: none;
    25602560        }
    25612561        #branding img {