函数原型
has_excerpt( int|WP_Post $post ): bool
函数描述
Determines whether the post has a custom excerpt.
是否弃用
未弃用
函数参数
-
$post
int|WP_Post
Optional - Post ID or WP_Post object. Default is global $post.
函数返回值
bool True if the post has a custom excerpt, false otherwise.
函数位置
File: wp-includes/post-template.php.
函数源码
function has_excerpt( $post = 0 ) {
$post = get_post( $post );
return ( ! empty( $post->post_excerpt ) );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |

