I’ve actually found a solution to my problem here:
Altering the appearance of custom taxonomy inputs but I wanted to ask a followup question, and it seems I couldn’t ask in that thread.
Here’s the code provided on that thread that seemed to work.
add_action('add_meta_boxes','mysite_add_meta_boxes',10,2);
function mysite_add_meta_boxes($post_type, $post) {
ob_start();
}
add_action('dbx_post_sidebar','mysite_dbx_post_sidebar');
function mysite_dbx_post_sidebar() {
$html = ob_get_clean();
$html = str_replace('"checkbox"','"radio"',$html);
echo $html;
}
When I use the code above, it does transform the checkboxes in all taxonomy boxes to a radio button. But I only want 3 boxes to change their checkboxes into a radio button. So how do you turn the checkboxes into radio buttons for a specific taxonomy box?
tnx.
hope it isn’t considered overly self-promotional, but i’ve turned stephen harris’ code into a plugin that will do this for you: http://wordpress.org/extend/plugins/radio-buttons-for-taxonomies/
i’m still working on getting the quick edit to show radio buttons too, but that appears to be significantly harder.
The most straightforward way would be to to de-register the taxonomy’s metabox and replace it with your own custom metabox. Below is my attempt. There are some drawbacks though, without adding in some javascript, I was unable to replicate WordPress ‘add new term’ feature, consequently you can only select pre-existing categories. (Or a least I was, but it added a checkbox rather than radio button).