Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to see only own posts #7

Open
bueltge opened this issue Apr 3, 2013 · 3 comments
Open

Option to see only own posts #7

bueltge opened this issue Apr 3, 2013 · 3 comments

Comments

@bueltge
Copy link
Collaborator

bueltge commented Apr 3, 2013

users can only see their own posts and unable to see other posts.

@gine
Copy link

gine commented Dec 29, 2015

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

@bueltge
Copy link
Collaborator Author

bueltge commented Dec 29, 2015

This is a feature which from other users. Currently I will not implement this feature. Thanks for your helpful two cents!

@bueltge
Copy link
Collaborator Author

bueltge commented Mar 27, 2018

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' );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants