1

I am trying to get list of available taxonomies which WordPress admin users can use in menu section, like Categories, Tags, Product Categories, Product Tags or any custom taxonomy for custom post type. Using get_taxonomies results all taxonomies, some of which are not available in Menu screen, for example Product shipping Class (from woocommerce).

In short, I am trying to get all those taxonomies which are used with Post, Page, Products or any other Custom Post Type in right side of editing screen.

0

The taxonomies visible in the admin menu are exactly those taxonomies that were registered with show_in_menu = true and show_ui = true. For a reference on this, see the documentation on register_taxonomy, the function for adding (custom) taxonomies.

To query these taxonomies, use the corresponding parameters in get_taxonomies:

get_taxonomies( array(
    'show_ui' => true,
    'show_in_menu' => true,
) );
2
  • Thank you very much @engelen ! It works. Reason I miss it becasue I can not see it in documentation here and here Also after seeing your code, I saw many other parameters. Once again thank you very much – sanjay ojha Jun 15 '17 at 15:04
  • You're welcome, @sanjayojha! – engelen Jun 15 '17 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.