Add fallback setting for custom content types

This commit is contained in:
Robin Cornett
2016-03-31 11:36:55 -04:00
parent 963a170e4c
commit 1b4e5e8bf8
3 changed files with 40 additions and 9 deletions
@@ -160,11 +160,13 @@ class Display_Featured_Image_Genesis_Common {
}
}
$thumb_metadata = wp_get_attachment_metadata( get_post_thumbnail_id( get_the_ID() ) ); // needed only for the next line
$width = $thumb_metadata ? $thumb_metadata['width'] : '';
$medium = (int) apply_filters( 'displayfeaturedimagegenesis_set_medium_width', get_option( 'medium_size_w' ) );
if ( has_post_thumbnail() && $width > $medium ) {
$image_id = get_post_thumbnail_id( get_the_ID() );
if ( isset( $setting['fallback'][ $post_type ] ) && ! $setting['fallback'][ $post_type ] ) {
$thumb_metadata = wp_get_attachment_metadata( get_post_thumbnail_id( get_the_ID() ) ); // needed only for the next line
$width = $thumb_metadata ? $thumb_metadata['width'] : '';
$medium = (int) apply_filters( 'displayfeaturedimagegenesis_set_medium_width', get_option( 'medium_size_w' ) );
if ( has_post_thumbnail() && $width > $medium ) {
$image_id = get_post_thumbnail_id( get_the_ID() );
}
}
}