Sanity cast. see #15192.

git-svn-id: https://develop.svn.wordpress.org/trunk@16389 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-11-15 18:06:57 +00:00
parent 0b7f397e9b
commit 76a7d50069
1 changed files with 1 additions and 0 deletions

View File

@ -5268,6 +5268,7 @@ function get_post_format_string( $slug ) {
*/
function set_post_thumbnail( $post, $thumbnail_id ) {
$post = get_post( $post );
$thumbnail_id = absint( $thumbnail_id );
if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) {
$thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' );
if ( ! empty( $thumbnail_html ) ) {