Is there a way to replace the default checkboxes by radio buttons in the custom post type taxonomy UI? I have custom post type 'questions' with taxonomy 'answer type' (single selection [radio button], multiple selection [checkboxes] and pattern matching [dropdown boxes). I need to make sure the users can only pick one option from 'answer type'. Is there a way to get this done?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
When you register a taxonomy WordPress automatically handles producing the appropriate metabox. First you need to 'de-register' this default metabox:
Where
Then it is simply a matter of mimicking the 'default' hierarchal metabox markup but altering the checkboxes to radio buttons. The function that is responsible for producing the default mark-up can be found here: http://core.trac.wordpress.org/browser/tags/3.3/wp-admin/includes/meta-boxes.php#L307 I show in detail how to do this in this article I wrote. You may also find this corresponding repository helpful. |
|||
|
|