No authors in change author dropdown

The role “Reviewer” only has special capabilities, no other capabilities. To get into the author list you have to be at least a contributor or author.

function rb_addroles() {
    $role = get_role('contributor');
    remove_role( 'reviewer' );
    add_role( 'reviewer', 'Reviewer', $role->capabilities );

    $reviewer = get_role('reviewer');

    $reviewer->add_cap( 'edit_review' );
    $reviewer->add_cap( 'read_review' );
    $reviewer->add_cap( 'delete_review' );
}  
add_action( 'admin_init', 'rb_addroles' );

With this function a reviewer has contributor capabilities plus your special reviewer capabilities. You can change contributor in author to give them also editable powers in the back-end.

Btw you have to run the script only once, preferable in a plugin or functions.php with logged in admin account.

You can check the role by:

$reviewer = get_role('reviewer');
print_r($reviewer);

Leave a Comment