get_ancestors


get_ancestors ( $object_id = 0, $object_type = '', $resource_type = '' )

Parameters:
  • (int) object_id Optional. The ID of the object. Default 0.
  • (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.
  • (string) resource_type Optional. Type of resource $object_type is. Accepts 'post_type' or 'taxonomy'. Default empty.
Returns:
  • (int[]) An array of IDs of ancestors from lowest to highest in the hierarchy.
Defined at:
Change Log:
  • 4: .

Description

Gets an array of ancestor IDs for a given object.

Related Functions

get_post_ancestors, _get_post_ancestors, get_networks, get_network, wp_get_network

Top Google Results

User discussions

wpseek mobile