WordPress Hooks Explorer

Listing all hooks extracted WordPress Core


Details about get_ancestors

Back to home

Files

Filename Hook Type Line Number PHP Doc
wp-includes/taxonomy.php apply_filters 4882 /**
* Gets an array of ancestor IDs for a given object.
*
* @since 3.1.0
* @since 4.1.0 Introduced the `$resource_type` argument.
*
* @param int $object_id Optional. The ID of the object. Default 0.
* @param string $object_type Optional. The type of object for which we'll be retrieving
* ancestors. Accepts a post type or a taxonomy name. Default empty.
* @param string $resource_type Optional. Type of resource $object_type is. Accepts 'post_type'
* or 'taxonomy'. Default empty.
* @return int[] An array of IDs of ancestors from lowest to highest in the hierarchy.
*/
wp-includes/taxonomy.php apply_filters 4914 /**
* Filters a given object's ancestors.
*
* @since 3.1.0
* @since 4.1.1 Introduced the `$resource_type` parameter.
*
* @param int[] $ancestors An array of IDs of object ancestors.
* @param int $object_id Object ID.
* @param string $object_type Type of object.
* @param string $resource_type Type of resource $object_type is.
*/

Hook Parameters

Parameter Type Name Description