WordPress.org

Make WordPress Core

Changeset 31262


Ignore:
Timestamp:
01/21/2015 09:05:29 PM (6 years ago)
Author:
lancewillett
Message:

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

Location:
trunk/src/wp-content/themes/twentytwelve
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwelve/header.php

    r29842 r31262  
    4747
    4848        <?php if ( get_header_image() ) : ?>
    49         <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>
     49        <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>
    5050        <?php endif; ?>
    5151    </header><!-- #masthead -->
  • trunk/src/wp-content/themes/twentytwelve/inc/custom-header.php

    r30327 r31262  
    148148 */
    149149function twentytwelve_admin_header_image() {
     150    $style = 'color: #' . get_header_textcolor() . ';';
     151    if ( ! display_header_text() ) {
     152        $style = 'display: none;';
     153    }
    150154    ?>
    151155    <div id="headimg">
    152         <?php
    153         if ( ! display_header_text() )
    154             $style = ' style="display:none;"';
    155         else
    156             $style = ' style="color:#' . get_header_textcolor() . ';"';
    157         ?>
    158         <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>
    159         <h2 id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>
     156        <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>
     157        <h2 id="desc" class="displaying-header-text" style="<?php echo esc_attr( $style ); ?>"><?php bloginfo( 'description' ); ?></h2>
    160158        <?php $header_image = get_header_image();
    161159        if ( ! empty( $header_image ) ) : ?>
    162             <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="" />
     160            <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="" />
    163161        <?php endif; ?>
    164162    </div>
Note: See TracChangeset for help on using the changeset viewer.