Uses
Uses | Description |
---|---|
wp-includes/post.php: delete_post_meta() | Deletes a post meta field for the given post ID. |
wp-includes/post.php: get_post() | Retrieves post data given a post ID or post object. |
Removes the thumbnail (featured image) from the given post.
(int|WP_Post) (Required) Post ID or post object from which the thumbnail should be removed.
(bool) True on success, false on failure.
File: wp-includes/post.php
function delete_post_thumbnail( $post ) { $post = get_post( $post ); if ( $post ) { return delete_post_meta( $post->ID, '_thumbnail_id' ); } return false; }
Version | Description |
---|---|
3.3.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/delete_post_thumbnail