WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/01/2019 08:22:31 AM (2 years ago)
Author:
pento
Message:

Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in the default themes.

See #47632

File:
1 edited

Legend:

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

    r45218 r45581  
    103103                 * Check if this is a post or page, if it has a thumbnail, and if it's a big one
    104104                 */
    105                 if ( is_singular() && has_post_thumbnail( $post->ID ) &&
    106                         ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
    107                         $image[1] >= $header_image_width ) :
    108                     // Houston, we have a new header image!
    109                     echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
    110                 else :
     105                if ( is_singular() && has_post_thumbnail( $post->ID ) ) {
     106                    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
     107                    if ( $image && $image[1] >= $header_image_width ) {
     108                        // Houston, we have a new header image!
     109                        echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
     110                    }
     111                } else {
    111112                    // Compatibility with versions of WordPress prior to 3.4.
    112113                    if ( function_exists( 'get_custom_header' ) ) {
     
    119120                    ?>
    120121                    <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $header_image_width ); ?>" height="<?php echo esc_attr( $header_image_height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" />
    121                 <?php endif; // end check for featured image or standard header ?>
     122                    <?php
     123                } // end check for featured image or standard header
     124                ?>
    122125            </a>
    123126            <?php endif; // end check for removed header image ?>
Note: See TracChangeset for help on using the changeset viewer.