Twenty Thirteen: fix escaping and minor code style issues. See #29127.

git-svn-id: https://develop.svn.wordpress.org/trunk@31260 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Lance Willett 2015-01-21 20:48:45 +00:00
parent be28a2c9c5
commit 95f9a91d86
3 changed files with 11 additions and 8 deletions

View File

@ -146,7 +146,7 @@ function twentythirteen_fonts_url() {
'family' => urlencode( implode( '|', $font_families ) ), 'family' => urlencode( implode( '|', $font_families ) ),
'subset' => urlencode( 'latin,latin-ext' ), 'subset' => urlencode( 'latin,latin-ext' ),
); );
$fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" ); $fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' );
} }
return $fonts_url; return $fonts_url;
@ -319,7 +319,7 @@ if ( ! function_exists( 'twentythirteen_entry_meta' ) ) :
*/ */
function twentythirteen_entry_meta() { function twentythirteen_entry_meta() {
if ( is_sticky() && is_home() && ! is_paged() ) if ( is_sticky() && is_home() && ! is_paged() )
echo '<span class="featured-post">' . __( 'Sticky', 'twentythirteen' ) . '</span>'; echo '<span class="featured-post">' . esc_html__( 'Sticky', 'twentythirteen' ) . '</span>';
if ( ! has_post_format( 'link' ) && 'post' == get_post_type() ) if ( ! has_post_format( 'link' ) && 'post' == get_post_type() )
twentythirteen_entry_date(); twentythirteen_entry_date();
@ -413,7 +413,7 @@ function twentythirteen_the_attached_image() {
'post_type' => 'attachment', 'post_type' => 'attachment',
'post_mime_type' => 'image', 'post_mime_type' => 'image',
'order' => 'ASC', 'order' => 'ASC',
'orderby' => 'menu_order ID' 'orderby' => 'menu_order ID',
) ); ) );
// If there is more than 1 attachment in a gallery... // If there is more than 1 attachment in a gallery...

View File

@ -216,12 +216,15 @@ function twentythirteen_admin_header_style() {
* @since Twenty Thirteen 1.0 * @since Twenty Thirteen 1.0
*/ */
function twentythirteen_admin_header_image() { function twentythirteen_admin_header_image() {
$style = 'color: #' . get_header_textcolor() . ';';
if ( ! display_header_text() ) {
$style = 'display: none;';
}
?> ?>
<div id="headimg" style="background: url(<?php header_image(); ?>) no-repeat scroll top; background-size: 1600px auto;"> <div id="headimg" style="background: url(<?php echo esc_url( get_header_image() ); ?>) no-repeat scroll top; background-size: 1600px auto;">
<?php $style = ' style="color:#' . get_header_textcolor() . ';"'; ?>
<div class="home-link"> <div class="home-link">
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="#" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1> <h1 class="displaying-header-text"><a id="name" style="<?php echo esc_attr( $style ); ?>" onclick="return false;" href="#" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
<h2 id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2> <h2 id="desc" class="displaying-header-text" style="<?php echo esc_attr( $style ); ?>"><?php bloginfo( 'description' ); ?></h2>
</div> </div>
</div> </div>
<?php } <?php }

View File

@ -20,7 +20,7 @@ get_header(); ?>
<?php if ( have_posts() ) : ?> <?php if ( have_posts() ) : ?>
<header class="archive-header"> <header class="archive-header">
<h1 class="archive-title"><?php printf( __( '%s Archives', 'twentythirteen' ), '<span>' . get_post_format_string( get_post_format() ) . '</span>' ); ?></h1> <h1 class="archive-title"><?php printf( __( '%s Archives', 'twentythirteen' ), '<span>' . esc_html( get_post_format_string( get_post_format() ) ) . '</span>' ); ?></h1>
</header><!-- .archive-header --> </header><!-- .archive-header -->
<?php /* The loop */ ?> <?php /* The loop */ ?>