Twenty Twelve: more fixes for escaping and minor code style issues. See #29127.

Built from https://develop.svn.wordpress.org/trunk@31262


git-svn-id: http://core.svn.wordpress.org/trunk@31243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2015-01-21 21:06:23 +00:00
parent 0706da6c6d
commit 902aa0074f
2 changed files with 8 additions and 10 deletions

View File

@ -46,7 +46,7 @@
</nav><!-- #site-navigation -->
<?php if ( get_header_image() ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /></a>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /></a>
<?php endif; ?>
</header><!-- #masthead -->

View File

@ -147,19 +147,17 @@ function twentytwelve_admin_header_style() {
* @since Twenty Twelve 1.0
*/
function twentytwelve_admin_header_image() {
$style = 'color: #' . get_header_textcolor() . ';';
if ( ! display_header_text() ) {
$style = 'display: none;';
}
?>
<div id="headimg">
<?php
if ( ! display_header_text() )
$style = ' style="display:none;"';
else
$style = ' style="color:#' . get_header_textcolor() . ';"';
?>
<h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
<h2 id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>
<h1 class="displaying-header-text"><a id="name" style="<?php echo esc_attr( $style ); ?>" onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<h2 id="desc" class="displaying-header-text" style="<?php echo esc_attr( $style ); ?>"><?php bloginfo( 'description' ); ?></h2>
<?php $header_image = get_header_image();
if ( ! empty( $header_image ) ) : ?>
<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="" />
<?php endif; ?>
</div>
<?php }