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:
parent
030d69717c
commit
2e50c871ab
@ -150,8 +150,10 @@ 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
|
||||
unset( $metadata['image']['data'] );
|
||||
if ( isset( $metadata['image']['data'] ) )
|
||||
unset( $metadata['image']['data'] );
|
||||
|
||||
return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user