A WordPress-centric search engine for devs and theme authors



delete_post_thumbnail ›

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

Remove a post thumbnail.



Source

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