From 848d75c4cb0a3bba5b61a2c1ee0f21c65b929856 Mon Sep 17 00:00:00 2001 From: duck_ 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: http://svn.automattic.com/wordpress/trunk@20172 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 2ca5f3cc6..630b9b349 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;