wp_get_post_parent_id


wp_get_post_parent_id ( $post = null )

Parameters:
  • (int|WP_Post|null) post Optional. Post ID or post object. Defaults to global $post.
Returns:
  • (int|false) Post parent ID (which can be 0 if there is no parent), or false if the post does not exist.
Defined at:
Change Log:
  • 5: .

Description

Returns the ID of the post's parent.

Related Functions

get_post_parent, wp_get_post_cats, wp_get_post_revision, wp_get_post_revisions, wp_get_term_taxonomy_parent_id

Top Google Results

User discussions

wpseek mobile