Uma área de pesquisa sobre o WordPress para devs e autores do tema



delete_post_thumbnail ›

Desde3.3.0
Obsoleton/a
delete_post_thumbnail ( $post )
Parâmetros:
  • (int|WP_Post) $post Post ID or post object from which the thumbnail should be removed.
    Required: Yes
Retorna:
  • (bool) True on success, false on failure.
Definido em:
Codex:

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



Fonte

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