delete_post_thumbnail( int|WP_Post $post )

Remove a post thumbnail.


Description Description


Parameters Parameters

$post

(int|WP_Post) (Required) Post ID or post object where thumbnail should be removed from.


Top ↑

Return Return

(bool) True on success, false on failure.


Top ↑

Source Source

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;
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.3.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.