WPDev.one
Core Function
View Source on Trac ↗

_get_term_children()

_get_term_children( mixed $term_id, mixed $terms, mixed $taxonomy, mixed $ancestors = array() )

Gets the subset of $terms that are descendants of $term_id.

Parameters 4 required

Name / Type Description
$term_id
int

`.

Required
array

$terms The set of terms - either an array of term objects or term IDs - from which those that are descendants of $term_id will be chosen.

Required
$taxonomy
string

The taxonomy which determines the hierarchy of the terms.

Required
array

$ancestors Optional. Term ancestors that have already been identified. Passed by reference, to keep track of found terms when recursing the hierarchy. The array of located ancestors is used to prevent infinite recursion loops. For performance, `term_ids` are used as array keys, with 1 as value. Default empty array.

Required

Return Value

((array)
| WP_Error) The subset of $terms that are descendants of $term_id.

Function Information

Since Version
2.3.0
Source File
wp-includes/taxonomy.php
Advertisement