has_post_parent()
最后更新于:2021-11-27 05:09:29
has_post_parent( int|GC_Post|null$post=null)响应s whether the given post has a parent post.
参数
- $post
-
(int|GC_Post|null) (Optional) Post ID or GC_Post object. Default is global $post.
Default value: null
响应
(bool) Whether the post has a parent post.
源文件
文件: gc-includes/post-template.php
function has_post_parent( $post = null ) {
return (bool) get_post_parent( $post );
}