Codex

Function Reference/get post ancestors

Contents

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.

Examples

Notes

Change Log

Since: 2.5.0

Source File

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

Related

See also index of Function Reference and index of Template Tags.