Make WordPress Core

Ticket #23701: 23701.diff

File 23701.diff, 8.5 KB (added by obenland, 12 years ago)
  • wp-content/themes/twentythirteen/searchform.php

     
    1 <?php
    2 /**
    3  * The template for displaying search forms in Twenty Thirteen.
    4  *
    5  * @package WordPress
    6  * @subpackage Twenty_Thirteen
    7  * @since Twenty Thirteen 1.0
    8  */
    9 ?>
    10 <form method="get" id="searchform" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search">
    11         <label for="s" class="assistive-text"><?php _ex( 'Search', 'assistive text', 'twentythirteen' ); ?></label>
    12         <input type="search" class="field" name="s" value="<?php echo esc_attr( get_search_query() ); ?>" id="s" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'twentythirteen' ); ?>" />
    13         <input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'twentythirteen' ); ?>" />
    14 </form>
  • wp-content/themes/twentythirteen/comments.php

     
    3838                        if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
    3939                ?>
    4040                <nav class="navigation comment-navigation" role="navigation">
    41                         <h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1>
     41                        <h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1>
    4242                        <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentythirteen' ) ); ?></div>
    4343                        <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentythirteen' ) ); ?></div>
    4444                </nav>
  • wp-content/themes/twentythirteen/content-none.php

     
    2020        <?php elseif ( is_search() ) : ?>
    2121
    2222        <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with different keywords.', 'twentythirteen' ); ?></p>
    23         <?php get_search_form(); ?>
     23        <?php get_search_form( true, 'html5' ); ?>
    2424
    2525        <?php else : ?>
    2626
    2727        <p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentythirteen' ); ?></p>
    28         <?php get_search_form(); ?>
     28        <?php get_search_form( true, 'html5' ); ?>
    2929
    3030        <?php endif; ?>
    3131</div><!-- .page-content -->
  • wp-content/themes/twentythirteen/header.php

     
    4949                        <div id="navbar" class="navbar">
    5050                                <nav id="site-navigation" class="navigation main-navigation" role="navigation">
    5151                                        <h3 class="menu-toggle"><?php _e( 'Menu', 'twentythirteen' ); ?></h3>
    52                                         <a class="assistive-text skip-link" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentythirteen' ); ?>"><?php _e( 'Skip to content', 'twentythirteen' ); ?></a>
     52                                        <a class="screen-reader-text skip-link" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentythirteen' ); ?>"><?php _e( 'Skip to content', 'twentythirteen' ); ?></a>
    5353                                        <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
    54                                         <?php get_search_form(); ?>
    5554                                </nav><!-- #site-navigation -->
    5655                        </div><!-- #navbar -->
    5756                </header><!-- #masthead -->
  • wp-content/themes/twentythirteen/404.php

     
    2121                                        <h2><?php _e( 'This is somewhat embarrassing, isn&rsquo;t it?', 'twentythirteen' ); ?></h2>
    2222                                        <p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentythirteen' ); ?></p>
    2323
    24                                         <?php get_search_form(); ?>
     24                                        <?php get_search_form( true, 'html5' ); ?>
    2525                                </div><!-- .page-content -->
    2626                        </div><!-- .page-wrapper -->
    2727
  • wp-content/themes/twentythirteen/css/ie.css

     
    3232        left: 100%;
    3333}
    3434
    35 .site-header .searchform .field {
     35.site-header .searchform [type="search"] {
    3636        padding-top: 6px;
    3737}
    3838
     
    174174        width: 13px;
    175175}
    176176
    177 .ie7 .assistive-text,
    178 .ie7 .site .screen-reader-text {
     177.ie7 .screen-reader-text {
    179178        clip: rect(1px 1px 1px 1px); /* IE7 */
    180179}
    181180
     
    204203        left: 100%;
    205204}
    206205
    207 .ie7 .site-header .searchform .field {
     206.ie7 .site-header .searchform [type="search"] {
    208207        background-color: #fff;
    209208        border: 2px solid #c3c0ab;
    210209        cursor: text;
  • wp-content/themes/twentythirteen/style.css

     
    537537}
    538538
    539539/* Assistive text */
    540 .assistive-text {
     540.screen-reader-text {
    541541        position: absolute !important;
    542542        clip: rect(1px, 1px, 1px, 1px);
    543543}
    544544
    545 .assistive-text:hover,
    546 .assistive-text:active,
    547 .assistive-text:focus {
     545.screen-reader-text:hover,
     546.screen-reader-text:active,
     547.screen-reader-text:focus {
    548548        background-color: #f1f1f1;
    549549        border-radius: 3px;
    550550        box-shadow: 0 0 2px 2px rgba(0,0,0,.6);
     
    925925        width: 100%;
    926926}
    927927
    928 .main-navigation .searchform {
     928.site-header .searchform {
    929929        position: absolute;
    930930        right: 0;
    931931        top: 1px;
    932932}
    933933
    934 .site-header .searchform .field {
     934.site-header .searchform [type="search"] {
    935935        background-color: transparent;
    936936        background-image: url(images/search-icon.png);
    937937        background-position: 5px center;
     
    948948        width: 0;
    949949}
    950950
    951 .site-header .searchform .field:focus {
     951.site-header .searchform [type="search"]:focus {
    952952        background-color: #fff;
    953953        border: 2px solid #c3c0ab;
    954954        cursor: text;
     
    25242524}
    25252525
    25262526/* Search widget */
    2527 .searchform .submit {
     2527.searchform [type="submit"] {
    25282528        display: none;
    25292529}
    25302530
    2531 .widget .searchform .field {
     2531.widget .searchform [type="text"] {
    25322532        width: 100%;
    25332533}
    25342534
     
    31373137        (-webkit-min-device-pixel-ratio: 1.25),
    31383138        (min-resolution: 120dpi) {
    31393139
    3140         .site-header .searchform .field {
     3140        .site-header .searchform [type="search"] {
    31413141                background-image: url(images/search-icon-2x.png);
    31423142        }
    31433143
     
    31573157                font-size: 10pt;
    31583158        }
    31593159
    3160         footer a[rel=bookmark]:link:after,
    3161         footer a[rel=bookmark]:visited:after {
     3160        footer a[rel="bookmark"]:link:after,
     3161        footer a[rel="bookmark"]:visited:after {
    31623162                content: " [" attr(href) "] "; /* Show URLs */
    31633163        }
    31643164
  • wp-content/themes/twentythirteen/functions.php

     
    262262                return;
    263263        ?>
    264264        <nav class="navigation paging-navigation" role="navigation">
    265                 <h1 class="assistive-text"><?php _e( 'Posts navigation', 'twentythirteen' ); ?></h1>
     265                <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentythirteen' ); ?></h1>
    266266                <div class="nav-links">
    267267
    268268                        <?php if ( get_next_posts_link() ) : ?>
     
    298298                return;
    299299        ?>
    300300        <nav class="navigation post-navigation" role="navigation">
    301                 <h1 class="assistive-text"><?php _e( 'Post navigation', 'twentythirteen' ); ?></h1>
     301                <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentythirteen' ); ?></h1>
    302302                <div class="nav-links">
    303303
    304304                        <?php previous_post_link( '%link', _x( '<span class="meta-nav">&larr;</span> %title', 'Previous post link', 'twentythirteen' ) ); ?>
     
    486486endif;
    487487
    488488/**
     489 * Adds a search form to the main navigation.
     490 *
     491 * @since Twenty Thirteen 1.0
     492 *
     493 * @param string $menu
     494 * @return string
     495 */
     496function twentythirteen_navbar_searchform( $menu ) {
     497        return $menu .= get_search_form( false, 'html5' );
     498}
     499add_filter( 'wp_nav_menu',  'twentythirteen_navbar_searchform' );
     500add_filter( 'wp_page_menu', 'twentythirteen_navbar_searchform' );
     501
     502/**
    489503 * Extends the default WordPress body class to denote:
    490504 * 1. Custom fonts enabled.
    491505 * 2. Single or multiple authors.