Codex

Function Reference/get term children

Contents

Description

Merge all term children into a single array.

This recursive function will merge all of the children of $term into the same array. Only useful for taxonomies which are hierarchical.

Will return an empty array if $term does not exist in $taxonomy.

Usage

<?php get_term_children$term$taxonomy ?>

Parameters

$term
(string) (required) Name of Term to get children
Default: None
$taxonomy
(string) (required) Taxonomy Name
Default: None

Return Values

(array|WP_Error) 
List of Term Objects. WP_Error returned if $taxonomy does not exist

Examples

Notes

Change Log

Since: 2.3.0

Source File

get_term_children() is located in wp-includes/taxonomy.php.

Related

is_term, get_term, get_term_by, get_term_children, get_terms, wp_get_object_terms

See also index of Function Reference and index of Template Tags.