WordPress.org

Make WordPress Core

Ticket #23868: 23868-3.patch

File 23868-3.patch, 5.7 KB (added by WraithKenny, 13 months 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, 
     283.one-column #branding .searchform { 
    283284        right: 40px; 
    284285        top: 4em; 
    285286} 
     
    468469input[type=number] { 
    469470        padding: 3px; 
    470471} 
    471 input#s { 
     472input#s, 
     473.searchform input.field { 
    472474        background: url(images/search.png) no-repeat 5px 6px; 
    473475        -moz-border-radius: 2px; 
    474476        border-radius: 2px; 
     
    477479        line-height: 1.2em; 
    478480        padding: 4px 10px 4px 28px; 
    479481} 
    480 input#searchsubmit { 
     482input#searchsubmit, 
     483.searchform input.submit { 
    481484        display: none; 
    482485} 
    483486 
     
    636639} 
    637640 
    638641/* Search Form */ 
    639 #branding #searchform { 
     642#branding #searchform, 
     643#branding .searchform { 
    640644        position: absolute; 
    641645        top: 3.8em; 
    642646        right: 7.6%; 
    643647        text-align: right; 
    644648} 
    645 #branding #searchform div { 
     649#branding #searchform div, 
     650#branding .searchform div { 
    646651        margin: 0; 
    647652} 
    648 #branding #s { 
     653#branding #s, 
     654#branding .searchform .field { 
    649655        float: right; 
    650656        -webkit-transition-duration: 400ms; 
    651657        -webkit-transition-property: width, background; 
     
    658664        -o-transition-timing-function: ease; 
    659665        width: 72px; 
    660666} 
    661 #branding #s:focus { 
     667#branding #s:focus, 
     668#branding .searchform .field:focus { 
    662669        background-color: #f9f9f9; 
    663670        width: 196px; 
    664671} 
    665 #branding #searchsubmit { 
     672#branding #searchsubmit, 
     673#branding .searchform .submit { 
    666674        display: none; 
    667675} 
    668 #branding .only-search #searchform { 
     676#branding .only-search #searchform, 
     677#branding .only-search .searchform { 
    669678        top: 5px; 
    670679        z-index: 1; 
    671680} 
    672 #branding .only-search #s { 
     681#branding .only-search #s, 
     682#branding .only-search .searchform .field { 
    673683        background-color: #666; 
    674684        border-color: #000; 
    675685        color: #222; 
    676686} 
    677687#branding .only-search #s, 
    678 #branding .only-search #s:focus { 
     688#branding .only-search #s:focus, 
     689#branding .only-search .searchform .field, 
     690#branding .only-search .searchform .field:focus { 
    679691        width: 85%; 
    680692} 
    681 #branding .only-search #s:focus { 
     693#branding .only-search #s:focus, 
     694#branding .only-search .searchform .field:focus { 
    682695        background-color: #bbb; 
    683696} 
    684 #branding .with-image #searchform { 
     697#branding .with-image #searchform, 
     698#branding .with-image .searchform { 
    685699        top: auto; 
    686700        bottom: -27px; 
    687701        max-width: 195px; 
     
    803817        border-top: 1px solid #ddd; 
    804818        padding: 6px 10px 6px 0; 
    805819} 
    806 .entry-content #s { 
     820.entry-content #s, 
     821.entry-content .searchform .field { 
    807822        width: 75%; 
    808823} 
    809824.comment-content ul, 
     
    13221337/* =error404 
    13231338----------------------------------------------- */ 
    13241339 
    1325 .error404 #main #searchform { 
     1340.error404 #main #searchform, 
     1341.error404 #main .searchform { 
    13261342        background: #f9f9f9; 
    13271343        border: 1px solid #ddd; 
    13281344        border-width: 1px 0; 
     
    13301346        overflow: hidden; 
    13311347        padding: 1.625em 8.9%; 
    13321348} 
    1333 .error404 #main #s { 
     1349.error404 #main #s, 
     1350.error404 #main .searchform .field { 
    13341351        width: 95%; 
    13351352} 
    13361353.error404 #main .widget { 
     
    18091826.widget_search form { 
    18101827        margin: 0 0 1.625em; 
    18111828} 
    1812 .widget_search #s { 
     1829.widget_search #s, 
     1830.widget_search .searchform .field { 
    18131831        width: 77%; 
    18141832} 
    1815 .widget_search #searchsubmit { 
     1833.widget_search #searchsubmit, 
     1834.widget_search .searchform .submit { 
    18161835        background: #ddd; 
    18171836        border: 1px solid #ccc; 
    18181837        -webkit-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09); 
     
    18241843        position: relative; 
    18251844        top: -2px; 
    18261845} 
    1827 .widget_search #searchsubmit:active { 
     1846.widget_search #searchsubmit:active, 
     1847.widget_search .searchform .submit:active { 
    18281848        background: #1982d1; 
    18291849        border-color: #0861a5; 
    18301850        -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1); 
     
    24402460                margin-right: 0; 
    24412461        } 
    24422462        /* Make sure the logo and search form don't collide */ 
    2443         #branding #searchform { 
     2463        #branding #searchform, 
     2464        #branding .searchform { 
    24442465                top: 1.625em !important; 
    24452466        } 
    24462467        /* Floated content doesn't work well at this size */ 
     
    25552576        #site-description { 
    25562577                font-size: 10pt; 
    25572578        } 
    2558         #branding #searchform { 
     2579        #branding #searchform, 
     2580        #branding .searchform { 
    25592581                display: none; 
    25602582        } 
    25612583        #branding img {