Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

get_ancestors()

3 tags 1 category

get_ancestors() — Gets an array of ancestor IDs for a given object.

Inputs: $object_id (int): Optional. The ID of the object. Default 0. $object_type (string): Optional. The type of object for which we’ll be retrieving ancestors. Accepts a post type or a taxonomy name. Default empty. $resource_type (string): 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.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…