From 3790d70d283846671c996539cfdea65c2b7f3502 Mon Sep 17 00:00:00 2001 From: Jon Cave Date: Wed, 14 Mar 2012 09:48:57 +0000 Subject: [PATCH] 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 --- wp-includes/post.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 2ca5f3cc62..630b9b3494 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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;