get_term_children


get_term_children ( $term_id, $taxonomy )

Parameters:
  • (int) term_id ID of term to get children.
  • (string) taxonomy Taxonomy name.
Returns:
  • (array|WP_Error) List of term IDs. WP_Error returned if `$taxonomy` does not exist.
Defined at:

Description

Merges all term children into a single array of their IDs.This recursive function will merge all of the children of $term into the same array of term IDs. Only useful for taxonomies which are hierarchical. Will return an empty array if $term does not exist in $taxonomy.

Related Functions

_get_term_children, get_category_children, get_children, get_page_children, get_term_field

Top Google Results

User discussions

wpseek mobile