Ticket #17262: 17262.2.diff
File 17262.2.diff, 1.0 KB (added by , 11 years ago) |
---|
-
wp-includes/post.php
4246 4246 */ 4247 4247 function wp_get_attachment_thumb_file( $post_id = 0 ) { 4248 4248 $post_id = (int) $post_id; 4249 if ( ! $post = get_post( $post_id ) )4249 if ( ! $post = get_post( $post_id ) ) 4250 4250 return false; 4251 if ( ! is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) )4251 if ( ! is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) ) 4252 4252 return false; 4253 4253 4254 4254 $file = get_attached_file( $post->ID ); 4255 4255 4256 if ( !empty($imagedata['thumb']) && ($thumbfile = str_replace(basename($file), $imagedata['thumb'], $file)) && file_exists($thumbfile) ) 4256 if ( ! empty( $imagedata['sizes']['thumbnail']['file'] ) 4257 && ( $thumbfile = str_replace( basename( $file ), $imagedata['sizes']['thumbnail']['file'], $file ) ) 4258 && file_exists( $thumbfile ) ) 4257 4259 return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID ); 4258 4260 return false; 4259 4261 }