WordPress at a glance

delete_post_thumbnail() WP 1.0

Remove a post thumbnail.

No Hooks.

Return

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

Usage

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

Changelog

Since 3.3.0 Introduced.

Code of delete post thumbnail: wp-includes/post.php WP 5.2.4

<?php
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
    Hello, !     Log In . Register