Avoid a PHP warning in wp_generate_attachment_metadata() if $metadata is not an array. props asakurayoh. fixes #25649.

git-svn-id: https://develop.svn.wordpress.org/trunk@25968 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2013-10-28 16:42:36 +00:00
parent 030d69717c
commit 2e50c871ab

View File

@ -150,7 +150,9 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
update_post_meta( $attachment_id, '_thumbnail_id', $sub_attachment_id );
}
}
// remove the blob of binary data from the array
if ( isset( $metadata['image']['data'] ) )
unset( $metadata['image']['data'] );
return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );