1. <?php
  2.  
  3. add_action( 'meta_boxes', 'do_my_meta_boxes' );
  4.  
  5. function do_my_meta_boxes( $post_type ) {
  6.     remove_meta_box( 'my_taxonomydiv', $post_type, 'side' );
  7.     add_meta_box( 'my_taxonomydiv', 'My Taxonomy', 'my_meta_box', $post_type, 'side' );
  8. }
  9.  
  10. function my_meta_box( $post, $meta_box ) {
  11.  
  12.     $taxonomy = 'my_taxonomy';
  13.     $tax      = get_taxonomy( $taxonomy );
  14.     $selected = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
  15.  
  16.     ?>
  17.     <div id="taxonomy-<?php echo $taxonomy; ?>" class="categorydiv">
  18.  
  19.         <input type="hidden" name="tax_input[<?php echo $taxonomy; ?>][]" value="0" />
  20.  
  21.         <ul id="<?php echo $taxonomy; ?>checklist" class="list:<?php echo $taxonomy; ?> categorychecklist form-no-clear">
  22.             <?php
  23.                 wp_terms_checklist( $post->ID, array(
  24.                     'taxonomy'      => $taxonomy,
  25.                     'selected_cats' => $selected
  26.                 ) );
  27.             ?>
  28.         </ul>
  29.  
  30.     </div>
  31.     <?php
  32.  
  33. }
  34.  
  35. ?>