Here is my fix for it.
I may have missed something so please check
// Remove default categories/taxonomies boxes //
add_action( 'admin_menu' , 'remove_default_categories_box' );
function remove_default_categories_box() {
$options = get_option('aCategory');
foreach($options as $taxonomy){
$tax = get_taxonomy($taxonomy->slug);
$catSlug = $taxonomy->slug;
$catBox = $catSlug.'div';
$postType = $tax->object_type;
foreach ( $postType as $runPostType ):
if($taxonomy->replace == 1) remove_meta_box( $catBox, $runPostType, 'side' );
endforeach;
}
}
// Add categories/taxonomies custom boxes //
add_action( 'add_meta_boxes', 'add_aCategories_box' );
function add_aCategories_box(){
global $wpdb;
if (isWPMU()) $options = get_blog_option($wpdb->blogid, 'aCategory');
else $options = get_option('aCategory');
foreach($options as $taxonomy){
$tax = get_taxonomy($taxonomy->slug);
$catSlug = $taxonomy->slug;
$catBox = 'a-'.$catSlug;
$postType = $tax->object_type;
foreach ( $postType as $runPostType ):
if($taxonomy->replace == 1) add_meta_box( $catBox, $tax->labels->name, 'aCatSelect', $runPostType, 'side', 'core', array( 'catSlug' => $catSlug, 'options' => $taxonomy));
endforeach;
}
}