wp_get_post_parent_id( int $post_ID )
Return the post’s parent’s post_ID
Parameters
- $post_ID
-
(Required)
Return
(int|false) Post parent ID, otherwise false.
Source
File: wp-includes/post.php
function wp_get_post_parent_id( $post_ID ) {
$post = get_post( $post_ID );
if ( !$post || is_wp_error( $post ) )
return false;
return (int) $post->post_parent;
}
Changelog
Version | Description |
---|---|
WP-3.1.0 | Introduced. |