Retrieve list of taxonomies in json
Your problem is that your trying to access taxonomy data before it is registered. This doesn’t work: add_action(‘init’, ‘json_handler’); function json_handler(){ $categories = get_terms( ‘my_cat’, ‘orderby=count&hide_empty=0’ ); if( ! is_wp_error( $categories ) ) { // encode the $categories array as json print_r( json_encode( $categories ) ); } } add_action(‘init’, ‘create_stores_nonhierarchical_taxonomy’); function create_stores_nonhierarchical_taxonomy() { // Labels … Read more