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:
Jon Cave 2012-03-14 09:48:57 +00:00
parent 1a41092158
commit 3790d70d28
1 changed files with 1 additions and 2 deletions

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;