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:
duck_ 2012-03-14 09:48:57 +00:00
parent 6241238938
commit 848d75c4cb

View File

@ -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;