Make WordPress Core

Changeset 30896 for trunk


Ignore:
Timestamp:
12/16/2014 12:59:59 PM (9 years ago)
Author:
ocean90
Message:

Twenty Fifteen: Don't escape translated strings.

Replace every unnecessary instance of esc_html__() and esc_html_e() with just __() and _e().

see #30724.

Location:
trunk/src/wp-content/themes/twentyfifteen
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfifteen/404.php

    r30394 r30896  
    1515            <section class="error-404 not-found">
    1616                <header class="page-header">
    17                     <h1 class="page-title"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'twentyfifteen' ); ?></h1>
     17                    <h1 class="page-title"><?php _e( 'Oops! That page can&rsquo;t be found.', 'twentyfifteen' ); ?></h1>
    1818                </header><!-- .page-header -->
    1919
    2020                <div class="page-content">
    21                     <p><?php esc_html_e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentyfifteen' ); ?></p>
     21                    <p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentyfifteen' ); ?></p>
    2222
    2323                    <?php get_search_form(); ?>
  • trunk/src/wp-content/themes/twentyfifteen/author-bio.php

    r30805 r30896  
    1010
    1111<div class="author-info">
    12     <h2 class="author-heading"><?php esc_html_e( 'Published by', 'twentyfifteen' ); ?></h2>
     12    <h2 class="author-heading"><?php _e( 'Published by', 'twentyfifteen' ); ?></h2>
    1313    <div class="author-avatar">
    1414        <?php
  • trunk/src/wp-content/themes/twentyfifteen/comments.php

    r30394 r30896  
    5151        if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
    5252    ?>
    53         <p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'twentyfifteen' ); ?></p>
     53        <p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p>
    5454    <?php endif; ?>
    5555
  • trunk/src/wp-content/themes/twentyfifteen/content-link.php

    r30394 r30896  
    2929            /* translators: %s: Name of current post */
    3030            the_content( sprintf(
    31                 esc_html__( 'Continue reading %s', 'twentyfifteen' ),
     31                __( 'Continue reading %s', 'twentyfifteen' ),
    3232                the_title( '<span class="screen-reader-text">', '</span>', false )
    3333            ) );
    3434
    3535            wp_link_pages( array(
    36                 'before'      => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'twentyfifteen' ) . '</span>',
     36                'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>',
    3737                'after'       => '</div>',
    3838                'link_before' => '<span>',
    3939                'link_after'  => '</span>',
    40                 'pagelink'    => '<span class="screen-reader-text">' . esc_html__( 'Page', 'twentyfifteen' ) . ' </span>%',
     40                'pagelink'    => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%',
    4141                'separator'   => '<span class="screen-reader-text">, </span>',
    4242            ) );
     
    5454    <footer class="entry-footer">
    5555        <?php twentyfifteen_entry_meta(); ?>
    56         <?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
     56        <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
    5757    </footer>
    5858    <!-- .entry-footer -->
  • trunk/src/wp-content/themes/twentyfifteen/content-none.php

    r30394 r30896  
    1313<section class="no-results not-found">
    1414    <header class="page-header">
    15         <h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'twentyfifteen' ); ?></h1>
     15        <h1 class="page-title"><?php _e( 'Nothing Found', 'twentyfifteen' ); ?></h1>
    1616    </header><!-- .page-header -->
    1717
     
    2424        <?php elseif ( is_search() ) : ?>
    2525
    26             <p><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfifteen' ); ?></p>
     26            <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfifteen' ); ?></p>
    2727            <?php get_search_form(); ?>
    2828
    2929        <?php else : ?>
    3030
    31             <p><?php esc_html_e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentyfifteen' ); ?></p>
     31            <p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentyfifteen' ); ?></p>
    3232            <?php get_search_form(); ?>
    3333
  • trunk/src/wp-content/themes/twentyfifteen/content-page.php

    r30394 r30896  
    2323        <?php
    2424            wp_link_pages( array(
    25                 'before'      => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'twentyfifteen' ) . '</span>',
     25                'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>',
    2626                'after'       => '</div>',
    2727                'link_before' => '<span>',
    2828                'link_after'  => '</span>',
    29                 'pagelink'    => '<span class="screen-reader-text">' . esc_html__( 'Page', 'twentyfifteen' ) . ' </span>%',
     29                'pagelink'    => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%',
    3030                'separator'   => '<span class="screen-reader-text">, </span>',
    3131            ) );
     
    3333    </div><!-- .entry-content -->
    3434
    35     <?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); ?>
     35    <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); ?>
    3636
    3737</article><!-- #post-## -->
  • trunk/src/wp-content/themes/twentyfifteen/content-search.php

    r30394 r30896  
    2626        <footer class="entry-footer">
    2727            <?php twentyfifteen_entry_meta(); ?>
    28             <?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
     28            <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
    2929        </footer><!-- .entry-footer -->
    3030
    3131    <?php else : ?>
    3232
    33         <?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); ?>
     33        <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); ?>
    3434
    3535    <?php endif; ?>
  • trunk/src/wp-content/themes/twentyfifteen/content.php

    r30394 r30896  
    3131            /* translators: %s: Name of current post */
    3232            the_content( sprintf(
    33                 esc_html__( 'Continue reading %s', 'twentyfifteen' ),
     33                __( 'Continue reading %s', 'twentyfifteen' ),
    3434                the_title( '<span class="screen-reader-text">', '</span>', false )
    3535            ) );
    3636
    3737            wp_link_pages( array(
    38                 'before'      => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'twentyfifteen' ) . '</span>',
     38                'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>',
    3939                'after'       => '</div>',
    4040                'link_before' => '<span>',
    4141                'link_after'  => '</span>',
    42                 'pagelink'    => '<span class="screen-reader-text">' . esc_html__( 'Page', 'twentyfifteen' ) . ' </span>%',
     42                'pagelink'    => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%',
    4343                'separator'   => '<span class="screen-reader-text">, </span>',
    4444            ) );
     
    5555    <footer class="entry-footer">
    5656        <?php twentyfifteen_entry_meta(); ?>
    57         <?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
     57        <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
    5858    </footer><!-- .entry-footer -->
    5959
  • trunk/src/wp-content/themes/twentyfifteen/footer.php

    r30394 r30896  
    2323                do_action( 'twentyfifteen_credits' );
    2424            ?>
    25             <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyfifteen' ) ); ?>"><?php printf( esc_html__( 'Proudly powered by %s', 'twentyfifteen' ), 'WordPress' ); ?></a>
     25            <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyfifteen' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentyfifteen' ), 'WordPress' ); ?></a>
    2626        </div><!-- .site-info -->
    2727    </footer><!-- .site-footer -->
  • trunk/src/wp-content/themes/twentyfifteen/functions.php

    r30865 r30896  
    229229    wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20141212', true );
    230230    wp_localize_script( 'twentyfifteen-script', 'screenReaderText', array(
    231         'expand'   => '<span class="screen-reader-text">' . esc_html__( 'expand child menu', 'twentyfifteen' ) . '</span>',
    232         'collapse' => '<span class="screen-reader-text">' . esc_html__( 'collapse child menu', 'twentyfifteen' ) . '</span>',
     231        'expand'   => '<span class="screen-reader-text">' . __( 'expand child menu', 'twentyfifteen' ) . '</span>',
     232        'collapse' => '<span class="screen-reader-text">' . __( 'collapse child menu', 'twentyfifteen' ) . '</span>',
    233233    ) );
    234234}
  • trunk/src/wp-content/themes/twentyfifteen/header.php

    r30798 r30896  
    2525<body <?php body_class(); ?>>
    2626<div id="page" class="hfeed site">
    27     <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'twentyfifteen' ); ?></a>
     27    <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentyfifteen' ); ?></a>
    2828
    2929    <div id="sidebar" class="sidebar">
     
    4242                    <?php endif;
    4343                ?>
    44                 <button class="secondary-toggle"><?php esc_html_e( 'Menu and widgets', 'twentyfifteen' ); ?></button>
     44                <button class="secondary-toggle"><?php _e( 'Menu and widgets', 'twentyfifteen' ); ?></button>
    4545            </div><!-- .site-branding -->
    4646        </header><!-- .site-header -->
  • trunk/src/wp-content/themes/twentyfifteen/image.php

    r30394 r30896  
    2222                    <nav id="image-navigation" class="navigation image-navigation">
    2323                        <div class="nav-links">
    24                             <div class="nav-previous"><?php previous_image_link( false, esc_html__( 'Previous Image', 'twentyfifteen' ) ); ?></div><div class="nav-next"><?php next_image_link( false, esc_html__( 'Next Image', 'twentyfifteen' ) ); ?></div>
     24                            <div class="nav-previous"><?php previous_image_link( false, __( 'Previous Image', 'twentyfifteen' ) ); ?></div><div class="nav-next"><?php next_image_link( false, __( 'Next Image', 'twentyfifteen' ) ); ?></div>
    2525                        </div><!-- .nav-links -->
    2626                    </nav><!-- .image-navigation -->
     
    5757                            the_content();
    5858                            wp_link_pages( array(
    59                                 'before'      => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'twentyfifteen' ) . '</span>',
     59                                'before'      => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>',
    6060                                'after'       => '</div>',
    6161                                'link_before' => '<span>',
    6262                                'link_after'  => '</span>',
    63                                 'pagelink'    => '<span class="screen-reader-text">' . esc_html__( 'Page', 'twentyfifteen' ) . ' </span>%',
     63                                'pagelink'    => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%',
    6464                                'separator'   => '<span class="screen-reader-text">, </span>',
    6565                            ) );
     
    6969                    <footer class="entry-footer">
    7070                        <?php twentyfifteen_entry_meta(); ?>
    71                         <?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
     71                        <?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
    7272                    </footer><!-- .entry-footer -->
    7373
  • trunk/src/wp-content/themes/twentyfifteen/inc/customizer.php

    r30893 r30896  
    2929
    3030    $wp_customize->add_control( 'color_scheme', array(
    31         'label'    => esc_html__( 'Base Color Scheme', 'twentyfifteen' ),
     31        'label'    => __( 'Base Color Scheme', 'twentyfifteen' ),
    3232        'section'  => 'colors',
    3333        'type'     => 'select',
     
    4444
    4545    $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sidebar_textcolor', array(
    46         'label'       => esc_html__( 'Header and Sidebar Text Color', 'twentyfifteen' ),
    47         'description' => esc_html__( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ),
     46        'label'       => __( 'Header and Sidebar Text Color', 'twentyfifteen' ),
     47        'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ),
    4848        'section'     => 'colors',
    4949    ) ) );
     
    6060
    6161    $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_background_color', array(
    62         'label'       => esc_html__( 'Header and Sidebar Background Color', 'twentyfifteen' ),
    63         'description' => esc_html__( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ),
     62        'label'       => __( 'Header and Sidebar Background Color', 'twentyfifteen' ),
     63        'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ),
    6464        'section'     => 'colors',
    6565    ) ) );
    6666
    6767    // Add an additional description to the header image section.
    68     $wp_customize->get_section( 'header_image' )->description = esc_html__( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' );
     68    $wp_customize->get_section( 'header_image' )->description = __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' );
    6969}
    7070add_action( 'customize_register', 'twentyfifteen_customize_register', 11 );
     
    9090    return apply_filters( 'twentyfifteen_color_schemes', array(
    9191        'default' => array(
    92             'label'  => esc_html__( 'Default', 'twentyfifteen' ),
     92            'label'  => __( 'Default', 'twentyfifteen' ),
    9393            'colors' => array(
    9494                '#f1f1f1',
     
    101101        ),
    102102        'dark'    => array(
    103             'label'  => esc_html__( 'Dark', 'twentyfifteen' ),
     103            'label'  => __( 'Dark', 'twentyfifteen' ),
    104104            'colors' => array(
    105105                '#111111',
     
    112112        ),
    113113        'yellow'  => array(
    114             'label'  => esc_html__( 'Yellow', 'twentyfifteen' ),
     114            'label'  => __( 'Yellow', 'twentyfifteen' ),
    115115            'colors' => array(
    116116                '#f4ca16',
     
    123123        ),
    124124        'pink'    => array(
    125             'label'  => esc_html__( 'Pink', 'twentyfifteen' ),
     125            'label'  => __( 'Pink', 'twentyfifteen' ),
    126126            'colors' => array(
    127127                '#ffe5d1',
     
    134134        ),
    135135        'purple'  => array(
    136             'label'  => esc_html__( 'Purple', 'twentyfifteen' ),
     136            'label'  => __( 'Purple', 'twentyfifteen' ),
    137137            'colors' => array(
    138138                '#674970',
     
    145145        ),
    146146        'blue'   => array(
    147             'label'  => esc_html__( 'Blue', 'twentyfifteen' ),
     147            'label'  => __( 'Blue', 'twentyfifteen' ),
    148148            'colors' => array(
    149149                '#e9f2f9',
  • trunk/src/wp-content/themes/twentyfifteen/inc/template-tags.php

    r30781 r30896  
    2121    ?>
    2222    <nav class="navigation comment-navigation" role="navigation">
    23         <h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'twentyfifteen' ); ?></h2>
     23        <h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfifteen' ); ?></h2>
    2424        <div class="nav-links">
    2525            <?php
    26                 if ( $prev_link = get_previous_comments_link( esc_html__( 'Older Comments', 'twentyfifteen' ) ) ) :
     26                if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'twentyfifteen' ) ) ) :
    2727                    printf( '<div class="nav-previous">%s</div>', $prev_link );
    2828                endif;
    2929
    30                 if ( $next_link = get_next_comments_link( esc_html__( 'Newer Comments', 'twentyfifteen' ) ) ) :
     30                if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'twentyfifteen' ) ) ) :
    3131                    printf( '<div class="nav-next">%s</div>', $next_link );
    3232                endif;
     
    4747function twentyfifteen_entry_meta() {
    4848    if ( is_sticky() && is_home() && ! is_paged() ) {
    49         printf( '<span class="sticky-post">%s</span>', esc_html__( 'Featured', 'twentyfifteen' ) );
     49        printf( '<span class="sticky-post">%s</span>', __( 'Featured', 'twentyfifteen' ) );
    5050    }
    5151
     
    120120    if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
    121121        echo '<span class="comments-link">';
    122         comments_popup_link( esc_html__( 'Leave a comment', 'twentyfifteen' ), esc_html__( '1 Comment', 'twentyfifteen' ), esc_html__( '% Comments', 'twentyfifteen' ) );
     122        comments_popup_link( __( 'Leave a comment', 'twentyfifteen' ), __( '1 Comment', 'twentyfifteen' ), __( '% Comments', 'twentyfifteen' ) );
    123123        echo '</span>';
    124124    }
     
    235235        esc_url( get_permalink( get_the_ID() ) ),
    236236        /* translators: %s: Name of current post */
    237         sprintf( esc_html__( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
     237        sprintf( __( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
    238238        );
    239239    return ' &hellip; ' . $link;
  • trunk/src/wp-content/themes/twentyfifteen/search.php

    r30824 r30896  
    1616
    1717            <header class="page-header">
    18                 <h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'twentyfifteen' ), get_search_query() ); ?></h1>
     18                <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyfifteen' ), get_search_query() ); ?></h1>
    1919            </header><!-- .page-header -->
    2020
Note: See TracChangeset for help on using the changeset viewer.