Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

I am trying to change the checkboxes for the terms on the backend to radiobuttons. I found this topic: Altering the appearance of custom taxonomy inputsAltering the appearance of custom taxonomy inputs however wich helped me doing this. However, this will turn ALL terms checkboxes to radio buttons.

Is it possible to apply this only for one taxonomy?

My code:

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;
}

thanks

I am trying to change the checkboxes for the terms on the backend to radiobuttons. I found this topic: Altering the appearance of custom taxonomy inputs however wich helped me doing this. However, this will turn ALL terms checkboxes to radio buttons.

Is it possible to apply this only for one taxonomy?

My code:

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;
}

thanks

I am trying to change the checkboxes for the terms on the backend to radiobuttons. I found this topic: Altering the appearance of custom taxonomy inputs however wich helped me doing this. However, this will turn ALL terms checkboxes to radio buttons.

Is it possible to apply this only for one taxonomy?

My code:

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;
}

thanks

Tweeted twitter.com/#!/StackWordPress/status/448834365389570048
Source Link
Maartje
  • 547
  • 1
  • 9
  • 23

WordPress taxonomy radio buttons

I am trying to change the checkboxes for the terms on the backend to radiobuttons. I found this topic: Altering the appearance of custom taxonomy inputs however wich helped me doing this. However, this will turn ALL terms checkboxes to radio buttons.

Is it possible to apply this only for one taxonomy?

My code:

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;
}

thanks