Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter djripraw

    (@djripraw)

    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;
    	}
    }
    Plugin Author alek

    (@alekart)

    It was possible before. The plugin wasn’t updated for 1 year and seems to have some compatibility issues with WordPress 4.0.
    I’ll check it and update it as soon as I have some time.

    Plugin Author alek

    (@alekart)

    I was wrong, it wasn’t possible before. However there was a bug for new installations but not big enough to break the plugin.

    Your fix is OK for that, thank you.
    I will push the update now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issue when Taxonomy is shared between multiple post types’ is closed to new replies.