mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Use return value of update_post_meta() in set_post_thumbnail() instead of always returning true. Props webord. Fixes #20218.
git-svn-id: https://develop.svn.wordpress.org/trunk@20172 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -5178,8 +5178,7 @@ function set_post_thumbnail( $post, $thumbnail_id ) {
|
||||
if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) {
|
||||
$thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' );
|
||||
if ( ! empty( $thumbnail_html ) ) {
|
||||
update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id );
|
||||
return true;
|
||||
return update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id );
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user