Twenty Eleven: Correct the fallback to the default header if the featured image width is narrower than the `twentyeleven_header_image_width` setting.
Follow-up to [45581]. Props sabernhardt, macmanx, audrasjb. See #52516. Built from https://develop.svn.wordpress.org/trunk@50360 git-svn-id: http://core.svn.wordpress.org/trunk@49971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
95094becee
commit
9aaa579f0d
|
@ -103,12 +103,13 @@ if ( is_singular() && get_option( 'thread_comments' ) ) {
|
||||||
* The header image.
|
* The header image.
|
||||||
* Check if this is a post or page, if it has a thumbnail, and if it's a big one
|
* Check if this is a post or page, if it has a thumbnail, and if it's a big one
|
||||||
*/
|
*/
|
||||||
|
$image = false;
|
||||||
if ( is_singular() && has_post_thumbnail( $post->ID ) ) {
|
if ( is_singular() && has_post_thumbnail( $post->ID ) ) {
|
||||||
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
|
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
|
||||||
if ( $image && $image[1] >= $header_image_width ) {
|
}
|
||||||
// Houston, we have a new header image!
|
if ( $image && $image[1] >= $header_image_width ) {
|
||||||
echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
|
// Houston, we have a new header image!
|
||||||
}
|
echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
|
||||||
} else {
|
} else {
|
||||||
// Compatibility with versions of WordPress prior to 3.4.
|
// Compatibility with versions of WordPress prior to 3.4.
|
||||||
if ( function_exists( 'get_custom_header' ) ) {
|
if ( function_exists( 'get_custom_header' ) ) {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.7-beta2-50359';
|
$wp_version = '5.7-beta2-50360';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue