Multiple authors can't edit pages
-
When multiple authors are assigned to a
pageonly the primary author has editorial access. The functionality works fine for apost.I’m fairly certain this is because
add_coauthor_cap()is only adding capabilities for theposttype.
-
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.
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.phpline 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_pagesandedit_published_pagescapabilities, among others.edit_others_pagesisn’t a reasonable option for the site I’m running this on.Still, only the first listed author is able to edit anything.
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
postcapabilities:$post_type_object->cap->edit_postThe
$post_type_object->cap->edit_postvalue 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?
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:
http://wordpress.org/extend/plugins/co-authors-plus/Could someone who had this issue give me concrete steps to reproduce? Thanks
The topic ‘Multiple authors can't edit pages’ is closed to new replies.