Function Reference/get post ancestors
Languages:
English •
日本語 •
(Add your language)
Description
Retrieve the parents of the post based on the post ID.
Usage
<?php get_post_ancestors( $post ) ?>
Parameters
- $post
- (mixed) (required) Post ID or post object.
- Default: None
Return Values
- (array)
- Array of IDs or empty if no ancestors are found. The parent is returned as the first value in the array.
Examples
Notes
Change Log
Since: 2.5.0
Source File
get_post_ancestors() is located in wp-includes/post.php.
Related