Twenty Fifteen: Don't escape translated strings.

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

see #30724.
Built from https://develop.svn.wordpress.org/trunk@30896


git-svn-id: http://core.svn.wordpress.org/trunk@30886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2014-12-16 13:00:22 +00:00
parent 7e98a6647e
commit 289f29ac0b
15 changed files with 48 additions and 48 deletions

View File

@ -14,11 +14,11 @@ get_header(); ?>
<section class="error-404 not-found">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Oops! That page can&rsquo;t be found.', 'twentyfifteen' ); ?></h1>
<h1 class="page-title"><?php _e( 'Oops! That page can&rsquo;t be found.', 'twentyfifteen' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content">
<p><?php esc_html_e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentyfifteen' ); ?></p>
<p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentyfifteen' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .page-content -->

View File

@ -9,7 +9,7 @@
?>
<div class="author-info">
<h2 class="author-heading"><?php esc_html_e( 'Published by', 'twentyfifteen' ); ?></h2>
<h2 class="author-heading"><?php _e( 'Published by', 'twentyfifteen' ); ?></h2>
<div class="author-avatar">
<?php
/**

View File

@ -50,7 +50,7 @@ if ( post_password_required() ) {
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
<p class="no-comments"><?php esc_html_e( 'Comments are closed.', 'twentyfifteen' ); ?></p>
<p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfifteen' ); ?></p>
<?php endif; ?>
<?php comment_form(); ?>

View File

@ -28,16 +28,16 @@
<?php
/* translators: %s: Name of current post */
the_content( sprintf(
esc_html__( 'Continue reading %s', 'twentyfifteen' ),
__( 'Continue reading %s', 'twentyfifteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
) );
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'twentyfifteen' ) . '</span>',
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '<span class="screen-reader-text">' . esc_html__( 'Page', 'twentyfifteen' ) . ' </span>%',
'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%',
'separator' => '<span class="screen-reader-text">, </span>',
) );
?>
@ -53,7 +53,7 @@
<footer class="entry-footer">
<?php twentyfifteen_entry_meta(); ?>
<?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
<?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
</footer>
<!-- .entry-footer -->

View File

@ -12,7 +12,7 @@
<section class="no-results not-found">
<header class="page-header">
<h1 class="page-title"><?php esc_html_e( 'Nothing Found', 'twentyfifteen' ); ?></h1>
<h1 class="page-title"><?php _e( 'Nothing Found', 'twentyfifteen' ); ?></h1>
</header><!-- .page-header -->
<div class="page-content">
@ -23,12 +23,12 @@
<?php elseif ( is_search() ) : ?>
<p><?php esc_html_e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfifteen' ); ?></p>
<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'twentyfifteen' ); ?></p>
<?php get_search_form(); ?>
<?php else : ?>
<p><?php esc_html_e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentyfifteen' ); ?></p>
<p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentyfifteen' ); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>

View File

@ -22,16 +22,16 @@
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'twentyfifteen' ) . '</span>',
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '<span class="screen-reader-text">' . esc_html__( 'Page', 'twentyfifteen' ) . ' </span>%',
'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%',
'separator' => '<span class="screen-reader-text">, </span>',
) );
?>
</div><!-- .entry-content -->
<?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); ?>
<?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); ?>
</article><!-- #post-## -->

View File

@ -25,12 +25,12 @@
<footer class="entry-footer">
<?php twentyfifteen_entry_meta(); ?>
<?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
<?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
<?php else : ?>
<?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); ?>
<?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<footer class="entry-footer"><span class="edit-link">', '</span></footer><!-- .entry-footer -->' ); ?>
<?php endif; ?>

View File

@ -30,16 +30,16 @@
<?php
/* translators: %s: Name of current post */
the_content( sprintf(
esc_html__( 'Continue reading %s', 'twentyfifteen' ),
__( 'Continue reading %s', 'twentyfifteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
) );
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'twentyfifteen' ) . '</span>',
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '<span class="screen-reader-text">' . esc_html__( 'Page', 'twentyfifteen' ) . ' </span>%',
'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%',
'separator' => '<span class="screen-reader-text">, </span>',
) );
?>
@ -54,7 +54,7 @@
<footer class="entry-footer">
<?php twentyfifteen_entry_meta(); ?>
<?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
<?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->

View File

@ -22,7 +22,7 @@
*/
do_action( 'twentyfifteen_credits' );
?>
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyfifteen' ) ); ?>"><?php printf( esc_html__( 'Proudly powered by %s', 'twentyfifteen' ), 'WordPress' ); ?></a>
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'twentyfifteen' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentyfifteen' ), 'WordPress' ); ?></a>
</div><!-- .site-info -->
</footer><!-- .site-footer -->

View File

@ -228,8 +228,8 @@ function twentyfifteen_scripts() {
wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20141212', true );
wp_localize_script( 'twentyfifteen-script', 'screenReaderText', array(
'expand' => '<span class="screen-reader-text">' . esc_html__( 'expand child menu', 'twentyfifteen' ) . '</span>',
'collapse' => '<span class="screen-reader-text">' . esc_html__( 'collapse child menu', 'twentyfifteen' ) . '</span>',
'expand' => '<span class="screen-reader-text">' . __( 'expand child menu', 'twentyfifteen' ) . '</span>',
'collapse' => '<span class="screen-reader-text">' . __( 'collapse child menu', 'twentyfifteen' ) . '</span>',
) );
}
add_action( 'wp_enqueue_scripts', 'twentyfifteen_scripts' );

View File

@ -24,7 +24,7 @@
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'twentyfifteen' ); ?></a>
<a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'twentyfifteen' ); ?></a>
<div id="sidebar" class="sidebar">
<header id="masthead" class="site-header" role="banner">
@ -41,7 +41,7 @@
<p class="site-description"><?php echo esc_html( $description ); ?></p>
<?php endif;
?>
<button class="secondary-toggle"><?php esc_html_e( 'Menu and widgets', 'twentyfifteen' ); ?></button>
<button class="secondary-toggle"><?php _e( 'Menu and widgets', 'twentyfifteen' ); ?></button>
</div><!-- .site-branding -->
</header><!-- .site-header -->

View File

@ -21,7 +21,7 @@ get_header(); ?>
<nav id="image-navigation" class="navigation image-navigation">
<div class="nav-links">
<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>
<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>
</div><!-- .nav-links -->
</nav><!-- .image-navigation -->
@ -56,11 +56,11 @@ get_header(); ?>
<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'twentyfifteen' ) . '</span>',
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '<span class="screen-reader-text">' . esc_html__( 'Page', 'twentyfifteen' ) . ' </span>%',
'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%',
'separator' => '<span class="screen-reader-text">, </span>',
) );
?>
@ -68,7 +68,7 @@ get_header(); ?>
<footer class="entry-footer">
<?php twentyfifteen_entry_meta(); ?>
<?php edit_post_link( esc_html__( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
<?php edit_post_link( __( 'Edit', 'twentyfifteen' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-footer -->
</article><!-- #post-## -->

View File

@ -28,7 +28,7 @@ function twentyfifteen_customize_register( $wp_customize ) {
) );
$wp_customize->add_control( 'color_scheme', array(
'label' => esc_html__( 'Base Color Scheme', 'twentyfifteen' ),
'label' => __( 'Base Color Scheme', 'twentyfifteen' ),
'section' => 'colors',
'type' => 'select',
'choices' => twentyfifteen_get_color_scheme_choices(),
@ -43,8 +43,8 @@ function twentyfifteen_customize_register( $wp_customize ) {
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sidebar_textcolor', array(
'label' => esc_html__( 'Header and Sidebar Text Color', 'twentyfifteen' ),
'description' => esc_html__( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ),
'label' => __( 'Header and Sidebar Text Color', 'twentyfifteen' ),
'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ),
'section' => 'colors',
) ) );
@ -59,13 +59,13 @@ function twentyfifteen_customize_register( $wp_customize ) {
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_background_color', array(
'label' => esc_html__( 'Header and Sidebar Background Color', 'twentyfifteen' ),
'description' => esc_html__( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ),
'label' => __( 'Header and Sidebar Background Color', 'twentyfifteen' ),
'description' => __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' ),
'section' => 'colors',
) ) );
// Add an additional description to the header image section.
$wp_customize->get_section( 'header_image' )->description = esc_html__( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' );
$wp_customize->get_section( 'header_image' )->description = __( 'Applied to the header on small screens and the sidebar on wide screens.', 'twentyfifteen' );
}
add_action( 'customize_register', 'twentyfifteen_customize_register', 11 );
@ -89,7 +89,7 @@ add_action( 'customize_register', 'twentyfifteen_customize_register', 11 );
function twentyfifteen_get_color_schemes() {
return apply_filters( 'twentyfifteen_color_schemes', array(
'default' => array(
'label' => esc_html__( 'Default', 'twentyfifteen' ),
'label' => __( 'Default', 'twentyfifteen' ),
'colors' => array(
'#f1f1f1',
'#ffffff',
@ -100,7 +100,7 @@ function twentyfifteen_get_color_schemes() {
),
),
'dark' => array(
'label' => esc_html__( 'Dark', 'twentyfifteen' ),
'label' => __( 'Dark', 'twentyfifteen' ),
'colors' => array(
'#111111',
'#202020',
@ -111,7 +111,7 @@ function twentyfifteen_get_color_schemes() {
),
),
'yellow' => array(
'label' => esc_html__( 'Yellow', 'twentyfifteen' ),
'label' => __( 'Yellow', 'twentyfifteen' ),
'colors' => array(
'#f4ca16',
'#ffdf00',
@ -122,7 +122,7 @@ function twentyfifteen_get_color_schemes() {
),
),
'pink' => array(
'label' => esc_html__( 'Pink', 'twentyfifteen' ),
'label' => __( 'Pink', 'twentyfifteen' ),
'colors' => array(
'#ffe5d1',
'#e53b51',
@ -133,7 +133,7 @@ function twentyfifteen_get_color_schemes() {
),
),
'purple' => array(
'label' => esc_html__( 'Purple', 'twentyfifteen' ),
'label' => __( 'Purple', 'twentyfifteen' ),
'colors' => array(
'#674970',
'#2e2256',
@ -144,7 +144,7 @@ function twentyfifteen_get_color_schemes() {
),
),
'blue' => array(
'label' => esc_html__( 'Blue', 'twentyfifteen' ),
'label' => __( 'Blue', 'twentyfifteen' ),
'colors' => array(
'#e9f2f9',
'#55c3dc',

View File

@ -20,14 +20,14 @@ function twentyfifteen_comment_nav() {
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
?>
<nav class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'twentyfifteen' ); ?></h2>
<h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfifteen' ); ?></h2>
<div class="nav-links">
<?php
if ( $prev_link = get_previous_comments_link( esc_html__( 'Older Comments', 'twentyfifteen' ) ) ) :
if ( $prev_link = get_previous_comments_link( __( 'Older Comments', 'twentyfifteen' ) ) ) :
printf( '<div class="nav-previous">%s</div>', $prev_link );
endif;
if ( $next_link = get_next_comments_link( esc_html__( 'Newer Comments', 'twentyfifteen' ) ) ) :
if ( $next_link = get_next_comments_link( __( 'Newer Comments', 'twentyfifteen' ) ) ) :
printf( '<div class="nav-next">%s</div>', $next_link );
endif;
?>
@ -46,7 +46,7 @@ if ( ! function_exists( 'twentyfifteen_entry_meta' ) ) :
*/
function twentyfifteen_entry_meta() {
if ( is_sticky() && is_home() && ! is_paged() ) {
printf( '<span class="sticky-post">%s</span>', esc_html__( 'Featured', 'twentyfifteen' ) );
printf( '<span class="sticky-post">%s</span>', __( 'Featured', 'twentyfifteen' ) );
}
$format = get_post_format();
@ -119,7 +119,7 @@ function twentyfifteen_entry_meta() {
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '<span class="comments-link">';
comments_popup_link( esc_html__( 'Leave a comment', 'twentyfifteen' ), esc_html__( '1 Comment', 'twentyfifteen' ), esc_html__( '% Comments', 'twentyfifteen' ) );
comments_popup_link( __( 'Leave a comment', 'twentyfifteen' ), __( '1 Comment', 'twentyfifteen' ), __( '% Comments', 'twentyfifteen' ) );
echo '</span>';
}
}
@ -234,7 +234,7 @@ function twentyfifteen_excerpt_more( $more ) {
$link = sprintf( '<a href="%1$s" class="more-link">%2$s</a>',
esc_url( get_permalink( get_the_ID() ) ),
/* translators: %s: Name of current post */
sprintf( esc_html__( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
sprintf( __( 'Continue reading %s', 'twentyfifteen' ), '<span class="screen-reader-text">' . get_the_title( get_the_ID() ) . '</span>' )
);
return ' &hellip; ' . $link;
}

View File

@ -15,7 +15,7 @@ get_header(); ?>
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'twentyfifteen' ), get_search_query() ); ?></h1>
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyfifteen' ), get_search_query() ); ?></h1>
</header><!-- .page-header -->
<?php