has_post_parent
has_post_parent ( $post = null )
Parameters:- (int|WP_Post|null) post Optional. Post ID or WP_Post object. Default is global $post.
Returns:- (bool) Whether the post has a parent post.
Defined at: - Introduced in WordPress: 5.7.0
- Deprecated in WordPress: —
Description
Returns whether the given post has a parent post.