WordPress开发者和主题制作者的搜索引擎



delete_post_thumbnail ›

Since3.3.0
已弃用n/a
delete_post_thumbnail ( $post )
参数:
  • (int|WP_Post) $post Post ID or post object from which the thumbnail should be removed.
    Required: Yes
返回:
  • (bool) True on success, false on failure.
定义在:
文档:

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



源码

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