0

I want to show a custom taxonomy in the name of custom_tax in a plugin option page as dropdown that user can select terms of taxonomy. I know that I can use wp_dropdown_categories() but I don't want show the terms of category taxonomy. I'm going to show my custom taxonomy terms as dropdown. Is there any function to do that? or no how can I do that?

2 Answers 2

1

wp_dropdown_categories() has the taxonomy parameter, which defaults to category, but can be used to retrieve custom taxonomies. Exemplary usage:

wp_dropdown_categories([
  'taxonomy' => 'custom-taxonomy-name'
]);
-2

get_terms() function should help you. An example:

$terms = get_terms( array(
    'taxonomy' => 'custom_tax',
) );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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