get_term_children( integer $term_id, string $taxonomy )
Merge all term children into a single array of their IDs.
You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.
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.
ID of Term to get children.
array | WP_Error
List of Term IDs. WP_Error returned if
$taxonomy does not exist.