authors shall only see their own posts (where they are co-author)
-
Hey guys,
first of all thanks for the good work! ??
I would like to modify the wordpress backend in a way, so that users of a certain role can only see their own posts (and documents for that matter; I am using WP document revisions for that). There are not really any plugins for that (at least ones that are still maintained), however I found this piece of code that I put into my functions.php:
function mypo_parse_query_useronly( $wp_query ) { if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) { if ( !current_user_can( 'level_10' ) ) { global $current_user; $wp_query->set( 'author', $current_user->id ); } } } add_filter('parse_query', 'mypo_parse_query_useronly' );
However, this piece of code doesn’t seem to work with coauthors plus: even though a certain user with the role “Editor” is coauthor of a post/document, he can not see the post. Since I am (unfortunately) a php/wordpress noob, I can’t figure it out…
I would be very happy for any suggestions,
thanks for the Help,
Stickhead
https://www.ads-software.com/extend/plugins/co-authors-plus/
- The topic ‘authors shall only see their own posts (where they are co-author)’ is closed to new replies.