Allowing authors to set co-authors

In the forums, whoaloic asks:

I have a site with multiple authors.
I would like to allow authors who create a post or a page to give rights to other authors.
For now, only administrator and editor can do that.
Is there a solution?

Yep, totally doable. By default, Co-Authors Plus defaults to ‘edit_others_posts’ as the required cap for changing co-authors. With the following code snippet in your theme’s functions.php file, you can make that cap ‘publish_posts’ instead (which authors and above usually have).

[sourcecode language=”php”]
* Filter the Co-Authors Plus current_user_can_set_authors() function
* so that users with ‘publish_posts’ can set Co-Authors
* @author danielbachhuber
* @see
* @see
add_filter( ‘coauthors_plus_edit_authors’, ‘db_filter_coauthors_edit_cap’ );
function db_filter_coauthors_edit_cap( $cap_result ) {
global $coauthors_plus;

$post_type = $coauthors_plus->get_current_post_type();
if( ! $post_type ) return false;

$post_type_object = get_post_type_object( $post_type );
return current_user_can( $post_type_object->cap->publish_posts );

In preparing this snippet, I also opened a couple of issues in Github: