Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (8 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

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

    r36709 r42343  
    5555function twentytwelve_custom_header_fonts() {
    5656    $font_url = twentytwelve_get_font_url();
    57     if ( ! empty( $font_url ) )
     57    if ( ! empty( $font_url ) ) {
    5858        wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
     59    }
    5960}
    6061add_action( 'admin_print_styles-appearance_page_custom-header', 'twentytwelve_custom_header_fonts' );
     
    7172
    7273    // If no custom options for text are set, let's bail
    73     if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) )
     74    if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) {
    7475        return;
     76    }
    7577
    7678    // If we get this far, we have custom styles.
     
    7981    <?php
    8082        // Has the text been hidden?
    81         if ( ! display_header_text() ) :
     83    if ( ! display_header_text() ) :
    8284    ?>
    83         .site-title,
    84         .site-description {
    85             position: absolute;
    86             clip: rect(1px 1px 1px 1px); /* IE7 */
    87             clip: rect(1px, 1px, 1px, 1px);
    88         }
     85    .site-title,
     86    .site-description {
     87        position: absolute;
     88        clip: rect(1px 1px 1px 1px); /* IE7 */
     89        clip: rect(1px, 1px, 1px, 1px);
     90    }
    8991    <?php
    90         // If the user has set a custom color for the text, use that.
     92    // If the user has set a custom color for the text, use that.
    9193        else :
    9294    ?>
     
    156158        <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>
    157159        <h2 id="desc" class="displaying-header-text" style="<?php echo esc_attr( $style ); ?>"><?php bloginfo( 'description' ); ?></h2>
    158         <?php $header_image = get_header_image();
    159         if ( ! empty( $header_image ) ) : ?>
     160        <?php
     161        $header_image = get_header_image();
     162        if ( ! empty( $header_image ) ) :
     163        ?>
    160164            <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="" />
    161165        <?php endif; ?>
    162166    </div>
    163 <?php }
     167<?php
     168}
Note: See TracChangeset for help on using the changeset viewer.