1

I have a post type called fi. For that I have a custom taxonomy called fi_types. fi_types contains 5 terms.

How do I require a user to specify at least one term within this taxonomy? Preferably the Other term.

Thanks for any help.

  • Do you simply want to add the Other term to the post if the user hasn't added any terms? Would that solution work for you? – Linnea Huxford Dec 18 '16 at 15:35
  • @LinneaHuxford Yes that will work perfectly. – Patrik Alienus Dec 19 '16 at 7:36
0

I'm working on something similar at the moment. I've decided on using radio buttons or a dropdown to ensure a user has to pick from my taxonomy terms when creating their post.

I'm still refinig my solution, but these two articles have helped me a lot:

http://themefoundation.com/wordpress-meta-boxes-guide/

I want my metabox to appear in multiple post types so I've used this too:

https://wordpress.org/ideas/topic/add-meta-box-to-multiple-post-types

Hope this helps. I will endeavour to update if I change the example code in the articles significantly.

  • Seems like it'd be a lot easier to just use Advanced Custom Fields for this. I'm already using ACF for the site. In it I could simply add a taxonomy field and make it required. However I would have to hide the normal box (in order to prevent the user from specifying the same thing twice) and that's not ideal. I wanna use the default meta box for the terms. – Patrik Alienus Dec 14 '16 at 15:59

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.