I have created this post type for the Human Resources role:
// Careers
add_action( 'init', 'create_careers' );
function create_careers() {
register_post_type( 'careers',
array(
'labels' => array(
'name' => __( 'Careers' ),
'singular_name' => __( 'Career' ),
'add_new' => __( 'Add New' ),
'add_new_item' => __( 'Add New Career' ),
'edit' => __( 'Edit' ),
'edit_item' => __( 'Edit Career' ),
'new_item' => __( 'New Career' ),
'view' => __( 'View Career' ),
'view_item' => __( 'View Career' ),
'search_items' => __( 'Search Careers' ),
'not_found' => __( 'No Careers found' ),
'not_found_in_trash' => __( 'No Careers found in Trash' ),
),
'public' => true,
'capabilities' => array(
'edit_post' => 'edit_career',
'edit_posts' => 'edit_careers',
'edit_others_posts' => 'edit_others_careers',
'publish_posts' => 'publish_careers',
'read_post' => 'read_careers',
'delete_post' => 'delete_careers',
),
'rewrite' => array( 'slug' => 'opportunities/careers', 'with_front' => false ),
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'revisions'),
)
);
}
In the Members Plugin I have assigned the following capabilities for the Human Resources role:
delete_careers
edit_careers
edit_career
edit_others_careers
edit_other_career
publish_careers
read_careers
read
upload_files
I have 2 users that have the Human Resources role - test and test2.
When I log in as a Human Resources role (user is test) I can't select other Human Resources users when editing careers - because the Author Metabox is not present.
I can see admins and editors but not sibling Human Resource roles in the post_author_override when logged in as Admin.
For example test creates a post. Test logs out and logs in as Admin. Admin can see the post_author_override drop down list containing only one of the Human Resources Role — the one that created the post originally. I can't change it to user test2.
Additionally I get a You are not allowed to edit this post error if logged in as Human Resources person.