WordPress get_term_children() Function

The get_term_children() is a WordPress builtin function and it will 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.

Return Values:

array|WP_Error) Array of Term IDs. WP_Error returned if $taxonomy does not exist.

Examples 1: get_term_children() function:

Output:

Source File: 

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

If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.