Warning: This function has been deprecated. Use get_post_ancestors() instead.

_get_post_ancestors() WordPress Function

The get_post_ancestors() function is used to get the ancestors of a post. This function returns an array of ancestor IDs, from the top-level ancestor (the parent of the parent of the post) to the immediate ancestor (the parent of the post).

_get_post_ancestors( WP_Post $post ) #

Retrieve post ancestors.


Description

This is no longer needed as WP_Post lazy-loads the ancestors property with get_post_ancestors().

Top ↑

See also


Top ↑

Parameters

$post

(WP_Post)(Required)Post object, passed by reference (unused).


Top ↑

Source

File: wp-includes/deprecated.php

function _get_post_ancestors( &$post ) {
	_deprecated_function( __FUNCTION__, '3.5.0' );
}


Top ↑

Changelog

Changelog
VersionDescription
3.5.0Use get_post_ancestors()
2.3.4Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.