Make sure attachment meta data is an array. Props nbachiyski. fixes #7252
git-svn-id: https://develop.svn.wordpress.org/trunk@8261 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7dccf2c37c
commit
ecf41b5b88
@ -274,7 +274,7 @@ function image_make_intermediate_size($file, $width, $height, $crop=false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function image_get_intermediate_size($post_id, $size='thumbnail') {
|
function image_get_intermediate_size($post_id, $size='thumbnail') {
|
||||||
if ( !$imagedata = wp_get_attachment_metadata( $post_id ) )
|
if ( !is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// get the best one for a specified set of dimensions
|
// get the best one for a specified set of dimensions
|
||||||
|
@ -2424,7 +2424,7 @@ function wp_get_attachment_thumb_file( $post_id = 0 ) {
|
|||||||
$post_id = (int) $post_id;
|
$post_id = (int) $post_id;
|
||||||
if ( !$post =& get_post( $post_id ) )
|
if ( !$post =& get_post( $post_id ) )
|
||||||
return false;
|
return false;
|
||||||
if ( !$imagedata = wp_get_attachment_metadata( $post->ID ) )
|
if ( !is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$file = get_attached_file( $post->ID );
|
$file = get_attached_file( $post->ID );
|
||||||
|
Loading…
Reference in New Issue
Block a user