Open bueltge opened 11 years ago
author and contributor roles can see only their own posts like you want. it's setted by capabilities. i don't understand why you want set to editor or admin roles to see only their posts.
if you want that, you must chose another role for your user. Maybe you can manage to create and personalize roles and capabilities. But there are a lot of plugins that work on that.
Maybe you can manage to add a filter on the article list for admin and editor, in this mode they can filter and reduce post to see, maybe you can set this filter for default list view.
my 2 cents
This is a feature which from other users. Currently I will not implement this feature. Thanks for your helpful two cents!
Also a hint to the support forum, similar question again and again and a small code hint. https://wordpress.org/support/topic/add-your-own-options-example/#post-10119823
function fb_posts_for_current_author($query) {
global $pagenow;
if ( 'edit.php' !== $pagenow || ! $query->is_admin )
return $query;
if ( ! current_user_can( 'edit_others_posts' ) ) {
global $user_ID;
$query->set( 'author', $user_ID );
}
return $query;
}
add_filter( 'pre_get_posts', 'fb_posts_for_current_author' );
users can only see their own posts and unable to see other posts.