wp-media / adminimize

Adminimize is a WordPress plugin that lets you hide 'unnecessary' items from the WordPress backend.
https://wordpress.org/plugins/adminimize/
GNU General Public License v2.0
100 stars 30 forks source link

Option to see only own posts #7

Open bueltge opened 11 years ago

bueltge commented 11 years ago

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

gine commented 8 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

bueltge commented 8 years ago

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

bueltge commented 6 years ago

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