Custom Roll/Custom Post Type – Can’t Select Categories

I am using Justin Tadlock’s Members plugin 0.2.4.

I have a custom user role “Author” that I am granting permission to post a Custom Post Type “blogpost”. The Author can post and edit the CPT blogpost however cannot add categories as the check-boxes are grayed out.

Read More

Others have reported similar problems in his plugin’s support forum over a year ago but the the user’s question seems unanswered and is now closed.

I am aware that enabling the “edit_posts” capability fixes the problem however gives the custom user role access to all post types which they should not have and is very bad.

Some have tried creating custom taxonomies to work around this, which reportedly worked for their custom user role. However, that does not work for my site as I have built it primarily using the default taxonomy provided in the core and I am quite far along in development.

Any help explaining to me what I have done wrong, or how to better configure Justin Tadlock’s Members plugin would be very greatly appreciated.

Thank you.

Related posts

2 comments

  1. I had the same problem, a custom role couldn’t assign categories to my CPT.
    When doing register_taxonomy(), I added these capabilities:

                'capabilities' => array (
                    'manage_terms' => 'manage_options', //by default only admin
                    'edit_terms' => 'manage_options',
                    'delete_terms' => 'manage_options',
                    'assign_terms' => 'edit_cpt-type'  // can edit cpt-type i.e. custom role
            ),
    

    Hope this helps to people and cyborgs having this problem.

  2. Maybe the name of your CPT needs to be changed

    blogpost
    

    You could also add taxonomy type support

    add_action( 'init', 'add_type_taxonomy' );
    function add_type_taxonomy() {
    
    register_taxonomy( 'cpt-type', 'cpt',
        array(
            'labels' => array(
                'name'          => _x( 'Types', 'taxonomy general name', 'theme' ),
                'add_new_item'  => __( 'Add New CPT Type', 'theme' ),
                'new_item_name' => __( 'New CPT Type', 'theme' ),
            ),
            'exclude_from_search' => true,
            'has_archive'         => true,
            'hierarchical'        => true,
            'rewrite'             => array( 'slug' => 'cpt-type', 'with_front' => false ),
            'show_ui'             => true,
            'show_tagcloud'       => false,
        )
    );
    
    }
    

    Replace all instances of cpt and CPT with the name of your Custom Post Type.

    You would also change this line of code in your code which registers your CPT:

    'taxonomies'   => array( 'category' ),
    

    With this line if you want taxonomies instead of categories

    'taxonomies'   => array( 'cpt-type' ),
    

    Where cpt is the name of your custom post type

Comments are closed.