WordPress at Your Fingertips

has_post_parent() WP 1.0

Returns whether the given post has a parent post.

No Hooks.


true|false. Whether the post has a parent post.


has_post_parent( $post );
Post ID or WP_Post object.
Default: global $post


Since 5.7.0 Introduced.

Code of has_post_parent() WP 5.8

function has_post_parent( $post = null ) {
	return (bool) get_post_parent( $post );

From category: Other

More from Template Tags: Posts, Pages, ...

No comments
    Log In