Removes the thumbnail (featured image) from the given post.
Parameters
$post
int|WP_Postrequired- Post ID or post object from which the thumbnail should be removed.
Source
function delete_post_thumbnail( $post ) {
$post = get_post( $post );
if ( $post ) {
return delete_post_meta( $post->ID, '_thumbnail_id' );
}
return false;
}
Changelog
Version | Description |
---|---|
3.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.