2 replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
source | link

I've actually found a solution to my problem here: http://wordpress.stackexchange.com/questions/7456/altering-the-appearance-of-custom-taxonomy-inputsAltering 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.

I've actually found a solution to my problem here: http://wordpress.stackexchange.com/questions/7456/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.

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.

    Tweeted twitter.com/#!/StackWordPress/status/175276626479820800
1
source | link

How To Change Custom Taxonomy To Radio Buttons

I've actually found a solution to my problem here: http://wordpress.stackexchange.com/questions/7456/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.