get_post_parent


get_post_parent ( $post = null )

Parameters:
  • (int|WP_Post|null) post Optional. Post ID or WP_Post object. Default is global $post.
Returns:
  • (WP_Post|null) Parent post object, or null if there isn't one.
Defined at:

Description

Retrieves the parent post object for the given post.

Related Functions

wp_get_post_parent_id, has_post_parent, get_post_meta, get_postdata, get_post_ancestors

Top Google Results

User discussions

wpseek mobile