get_post_ancestors
get_post_ancestors ( $post )
Parameters:- (int|WP_Post) post Post ID or post object.
Returns:- (int[]) Array of ancestor IDs or empty array if there are none.
Defined at: - Introduced in WordPress: 2.5.0
- Deprecated in WordPress: —
Description
Retrieves the IDs of the ancestors of a post.