delete_post_thumbnail(). props CoenJacobs, duck_. fixes #17895.
git-svn-id: http://svn.automattic.com/wordpress/trunk@18767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -5190,6 +5190,21 @@ function set_post_thumbnail( $post, $thumbnail_id ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a post thumbnail.
|
||||
*
|
||||
* @since 3.3.0
|
||||
*
|
||||
* @param int|object $post Post ID or object where thumbnail should be removed from.
|
||||
* @return bool True on success, false on failure.
|
||||
*/
|
||||
function delete_post_thumbnail( $post ) {
|
||||
$post = get_post( $post );
|
||||
if ( $post )
|
||||
return delete_post_meta( $post->ID, '_thumbnail_id' );
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a link to a post format index.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user