Sanity cast. see #15192.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bd638424fc
commit
29203134cb
|
@ -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 ) ) {
|
||||
|
|
Loading…
Reference in New Issue