wpseek.com
A WordPress-centric search engine for devs and theme authors



delete_post_thumbnail › WordPress Function

Since3.3.0
Deprecatedn/a
delete_post_thumbnail ( $post )
Parameters:
  • (int|WP_Post) $post Post ID or post object from which the thumbnail should be removed.
    Required: Yes
Returns:
  • (bool) True on success, false on failure.
Defined at:
Codex:

Removes the thumbnail (featured image) from the given post.



Source

function delete_post_thumbnail( $post ) {
	$post = get_post( $post );
	if ( $post ) {
		return delete_post_meta( $post->ID, '_thumbnail_id' );
	}
	return false;
}