mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-07 08:01:54 +01:00
Use return value of update_post_meta() in set_post_thumbnail() instead of always returning true. Props webord. Fixes #20218.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6241238938
commit
848d75c4cb
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user