WordPress at a glance

delete_post_thumbnail() WP 1.0

Remove a post thumbnail.


true/false. True on success, false on failure.

No Hooks.


delete_post_thumbnail( $post );
$post(int/WP_Post) (required)
Post ID or post object from which the thumbnail should be removed.

Список изменений

С версии 3.3.0 Введена.

Code of delete_post_thumbnail() WP 5.5.1

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

Related Functions

From tag: Thumbnail (images)

More from category: Thumbnails

No comments
    Log In . Register