Support » Plugin: Co-Authors Plus » Multiple authors can't edit pages

  • Resolved Patrick Daly


    When multiple authors are assigned to a page only the primary author has editorial access. The functionality works fine for a post.

    I’m fairly certain this is because add_coauthor_cap() is only adding capabilities for the post type.

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Daniel Bachhuber


    Thanks for the bug report. If you want a quick fix, the easiest thing to do would be to give whatever role you’re interested in the ‘edit_others_pages’ capability. I’ll see if I can prepare a proper fix too.

    Plugin Author Daniel Bachhuber


    As it turns out, it was a pretty simple fix. The taxonomy used for managing relationships between multiple authors and a post is only registered to the ‘post’ post type.

    You’ll need to register it fo the ‘page’ post type as well by using this snippet in your theme’s functions.php file:

    add_action( 'init', 'cap_register_taxonomy_for_pages' );
     * Register the taxonomy with pages so the Co-Authors Plus permissions lookup works properly
    function cap_register_taxonomy_for_pages() {
    	register_taxonomy( 'author', 'page' );

    Tried this out and nothing seemed to change. I also tried editing co-authors-plus.php line 79 to:

    register_taxonomy( $this->coauthor_taxonomy, array( 'post', 'page' ), array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => false, 'query_var' => false, 'rewrite' => false, 'sort' => true, 'show_ui' => true ) );

    … no luck either way.

    For further clarification, I’ve assigned 4 contributors to a single page. Contributors have edit_pages and edit_published_pages capabilities, among others. edit_others_pages isn’t a reasonable option for the site I’m running this on.

    Still, only the first listed author is able to edit anything.

    Plugin Author Daniel Bachhuber


    What other plugins do you have installed?

    I’ve tested with all plugins deactivated except this one.

    Also, this is a network site.

    You’re sure this isn’t stemming from add_coauthor_cap() ?

    Even though the post type object is being set as page, post, custom post type, etc. it still looks like its only receiving post capabilities: $post_type_object->cap->edit_post

    Plugin Author Daniel Bachhuber


    The $post_type_object->cap->edit_post value is “edit_page”, so the capabilities are being handled properly (as far as I could tell). I was able to reproduce your issue initially when I didn’t register the taxonomy for pages, but then it went away after I did.

    I have the same issue. Co-authors assigned to pages don’t have editing capability. Added the taxonomy code snippet to my functions.php in my Theme, no change though. Turned off all the plugins as well.

    Any ideas how to work around this? Is it necessary to recreate the pages?

    Plugin Author Daniel Bachhuber


    I’m interested again in fixing this if it’s still an issue.

    @patrick Daly: Make any progress on your end?

    I’m presently having this issue.

    I tried what you suggested earlier in this thread without success.

    any luck with a page editing fix? yeah, works great for posts!

    Ok. It took me a long time, but I figured out what the problem is. Line 833 of co-authors-plus.php checks for the publish_posts capability for already existing posts. The correct capability it ought to be checking is edit_published_posts. Therefore, change the two occurrences of publish_posts to edit_published_posts and it seems to work properly. The modified line will then look like: if ( 'publish' == $post->post_status && ( ! isset( $allcaps[$post_type_object->cap->edit_published_posts] ) || ! $allcaps[$post_type_object->cap->edit_published_posts] ) )

    I stumbled across this shortly after reading this thread. Could this plugin work for you guys? It appears to cover ‘page’ types:

    Plugin Author Daniel Bachhuber


    Could someone who had this issue give me concrete steps to reproduce? Thanks

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Multiple authors can't edit pages’ is closed to new replies.