Tag Info

New answers tagged


You're registering your taxonomy only if is_admin is true, so your taxonomy won't exist for any non-admin request. Taxonomies (and post types) have to be registered on every request.


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( ...

Top 50 recent answers are included