Make WordPress Core

Ticket #24815: v1.patch

File v1.patch, 886 bytes (added by Jonnyauk, 11 years ago)

Patch v1 - uses get_intermediate_image_sizes()

  • wp-includes/post-thumbnail-template.php

     
    8585function get_the_post_thumbnail( $post_id = null, $size = 'post-thumbnail', $attr = '' ) {
    8686        $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
    8787        $post_thumbnail_id = get_post_thumbnail_id( $post_id );
     88        // Default back to standard thumbnail dimensions if post-thumbnail size not set
     89        $size = ( in_array( $size, get_intermediate_image_sizes() ) ) ? $size : 'thumbnail';
    8890        $size = apply_filters( 'post_thumbnail_size', $size );
    8991        if ( $post_thumbnail_id ) {
    9092                do_action( 'begin_fetch_post_thumbnail_html', $post_id, $post_thumbnail_id, $size ); // for "Just In Time" filtering of all of wp_get_attachment_image()'s filters