WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/wp get post parent id

Contents

Description

Returns the post's parent's post_ID.

Usage

 <?php wp_get_post_parent_id$post_ID ); ?> 

Parameters

$post_id
(integer) (required) post ID.
Default: None

Return Value

(mixed)
Post's parent ID on success. False on error.

Change Log

Since: 3.1.0

Source File

wp_get_post_parent_id() is located in wp-includes/post.php.