WordPress.org

Make WordPress Core

Changeset 20223


Ignore:
Timestamp:
03/20/12 20:46:46 (3 years ago)
Author:
nacin
Message:

Remove use of HEADER_IMAGE_WIDTH and HEADER_IMAGE_HEIGHT from twentyeleven/header.php. see #20265.

File:
1 edited

Legend:

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

    r19599 r20223  
    7979                // Check to see if the header image has been removed 
    8080                $header_image = get_header_image(); 
    81                 if ( ! empty( $header_image ) ) : 
     81                if ( $header_image ) : 
     82                    $header_image_width  = get_theme_support( 'custom-header', 'width' ); 
     83                    $header_image_height = get_theme_support( 'custom-header', 'height' ); 
    8284            ?> 
    8385            <a href="<?php echo esc_url( home_url( '/' ) ); ?>"> 
     
    8789                    if ( is_singular() && 
    8890                            has_post_thumbnail( $post->ID ) && 
    89                             ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( HEADER_IMAGE_WIDTH, HEADER_IMAGE_WIDTH ) ) ) && 
    90                             $image[1] >= HEADER_IMAGE_WIDTH ) : 
     91                            ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) && 
     92                            $image[1] >= $header_image_width ) : 
    9193                        // Houston, we have a new header image! 
    9294                        echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 
    9395                    else : ?> 
    94                     <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" /> 
     96                    <img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" /> 
    9597                <?php endif; // end check for featured image or standard header ?> 
    9698            </a> 
     
    101103                if ( 'blank' == get_header_textcolor() ) : 
    102104            ?> 
    103                 <div class="only-search<?php if ( ! empty( $header_image ) ) : ?> with-image<?php endif; ?>"> 
     105                <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>"> 
    104106                <?php get_search_form(); ?> 
    105107                </div> 
Note: See TracChangeset for help on using the changeset viewer.