Custom Fields
Re-Envisioned
Support MB Custom Taxonomy Use a regular select when setting Custom Taxonomy of a Custom Post Type

  • Creator
    Topic
  • #27033
    Maxim Gladines
    Participant

    I have a custom post type called ‘Product’

    Product has a couple of custom taxonomies. However, I can now only assign a taxonomy to a product by autocomplete. I start typing and the value appears. However, how can I change this to a regular drop-down / select?

    Image: here

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #27042
    Long Nguyen
    Moderator

    Hi Maxim

    Default settings of a new taxonomy like the post tag, you need to type some keyword to show the term to assign to the post.

    You can edit the custom taxonomy > tab Advanced > check option Hierarchical to show it as the post category. Screenshots: https://share.getcloudapp.com/9ZuxEKDo.

    Another way, you can use the field type taxonomy or taxonomy_advanced to show it in any select type you want. Get more details here
    https://docs.metabox.io/fields/taxonomy/
    https://docs.metabox.io/fields/taxonomy-advanced/

    #27052
    Maxim Gladines
    Participant

    Hi Long,

    Thanks for the reply.

    If I were to add custom fields to allow the selecting of taxonomy, how can I avoid the taxonomy also automatically appearing with the post type? I don’t want two options of selecting a taxonomy.

    #27057
    Long Nguyen
    Moderator

    Hi,

    You can uncheck the option “Show on edit page” to remove the default taxonomy meta box on the editing post. Screenshot https://share.getcloudapp.com/9ZuxE1dw.

    #27063
    Maxim Gladines
    Participant

    Hi Long

    That in itself didn’t work in 5.7.
    I also had to add ‘meta_box_cb’ => false for it to work – can that be right?

    #27079
    Long Nguyen
    Moderator

    Hi Maxim,

    Uncheck option “Show on edit page” that means set 'meta_box_cb' => false. Please try to click on the button “Get PHP code” to check this option.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.