Custom taxonomy children (get_term_children) – BUG?
-
I can’t get WP to give me child terms on a custom taxonomy, here’s an example:
register_taxonomy( 'where-you-live', 'user', array('hierarchical' => true, 'show_ui' => true, 'query_var' => true, 'label' => __('Where they live')) ); $country = 'USA'; $state = 'New York'; $tax_country = wp_insert_term($country, 'where-you-live'); $country_term_id = $tax_country['term_id']; wp_insert_term($state, 'where-you-live', array('parent'=>$country_term_id)); $state_terms = get_child_terms($country_term_id, 'where-you-live'); error_log(print_r($state_terms,1));
This gives me an empty array. Have I done this wrong?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom taxonomy children (get_term_children) – BUG?’ is closed to new replies.