wpseek.com
A WordPress-centric search engine for devs and theme authors



has_post_parent › WordPress Function

Since5.7.0
Deprecatedn/a
has_post_parent ( $post = null )
Parameters:
  • (int|WP_Post|null) $post Optional. Post ID or WP_Post object. Default is global $post.
    Required: No
    Default: null
Returns:
  • (bool) Whether the post has a parent post.
Defined at:
Codex:

Returns whether the given post has a parent post.



Source

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