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.

2
  • 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? Commented Dec 18, 2016 at 15:35
  • @LinneaHuxford Yes that will work perfectly. Commented Dec 19, 2016 at 7:36

1 Answer 1

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.

1
  • 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. Commented Dec 14, 2016 at 15:59

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.