Co-Authors Plus checks for whether a user can ‘edit_others_posts‘.
Thread Starter
Mark
(@codeispoetry)
Thanks, that makes sense. Now my editor role can change authors on posts.
That answers only half of my question so I’m marking the topic as not resolved if you don’t mind. (I see though that my original question wasn’t the clearest formulation.) I’m also looking for the capabilities connected to viewing the list of guest authors via /wp-admin/users.php?page=view-guest-authors and adding new guest authors to it.
I can give my editor capabilities like list_users, add_users, create_users, edit_users, remove_users, delete_users. Which ones do I need to give them the possibility of viewing and adding to the guest author list? (And what’s the difference between add/create, and remove/delete?)
Thread Starter
Mark
(@codeispoetry)
Update: To test, I have just given the editor all user-related capabilities except promoting and deleting/removing users. No dice. I can’t get the Guest Authors page to show up for my editor.
Oh, I see what you’re talking about now. The required cap is ‘list_users‘ but that also is filterable.
Thread Starter
Mark
(@codeispoetry)
Great, works!
PS It might be useful to add these two pieces of information to the FAQ.
Hi, I am trying to set up this exact thing (let my editors create new guest authors). I’ve found the filter you mention in the class-coauthors-guest-authors.php file:
// Allow users to change the required cap for modifying guest authors
$this->list_guest_authors_cap = apply_filters( 'coauthors_guest_author_manage_cap', $this->list_guest_authors_cap );
But I’m afraid I’m not very php literate. Where do I put this code? In my WP capabilities.php file somewhere? Someplace else? Do I have to add more to it to define it specifically for the Editor role?
Sorry, I’m just a little lost. Thanks for any help!
Sure, you can drop the following into your theme’s functions.php file:
/**
* Allow editors to manage guest author profiles
*/
add_filter( 'coauthors_guest_author_manage_cap', 'capx_filter_guest_author_manage_cap' );
function capx_filter_guest_author_manage_cap( $cap ) {
return 'edit_others_posts';
}
Thanks so much, worked perfectly!