delete_post_thumbnail()
最后更新于:2021-11-26 00:48:21
delete_post_thumbnail( int|GC_Post$post)Removes the thumbnail (featured image) from the given post.
参数
- $post
-
(int|GC_Post) (Required) Post ID or post object from which the thumbnail should be removed.
响应
(bool) True on success, false on failure.
源文件
文件: gc-includes/post.php
function delete_post_thumbnail( $post ) {
$post = get_post( $post );
if ( $post ) {
return delete_post_meta( $post->ID, '_thumbnail_id' );
}
return false;
}