WordPress.org

Ready to get started?Download WordPress

Forums

How to hide other users' posts in admin panel (6 posts)

  1. relativity98
    Member
    Posted 3 years ago #

    Hi,

    I have a question, I have many users (Authors) who can log into WordPress admin panel to post their blog entries. But doing so, they all can see each others posts, even though not being able to edit any post but their own's.

    From users point of view, it is not the best thing in the world to look for your own posts in the list, especially if there are lots of users in the system.

    Same as the Media Taba and the Comment Tab.

    How can I hide them from users other than admin (myself)?

    Plugin would be good. If not, please point me to the relevant Code doc. Thank you.

    regards,
    Will

  2. Mark / t31os
    Moderator
    Posted 3 years ago #

    http://wordpress.org/support/topic/show-only-authors-posts-in-admin-panel-instead-of-all-posts

    Example based on the code i posted there.

    function posts_for_current_author($query) {
    	global $pagenow;
    
    	if( 'edit.php' != $pagenow || !$query->is_admin )
    	    return $query;
    
    	if( !current_user_can( 'manage_options' ) ) {
    		global $user_ID;
    		$query->set('author', $user_ID );
    	}
    	return $query;
    }
    add_filter('pre_get_posts', 'posts_for_current_author');
  3. relativity98
    Member
    Posted 3 years ago #

    Thanks Telos.

    I have read the link above. That was very innformative. Thank once again for the info.

    I am relatively new to WordPress... just wondering for the above scenario, would it be better to have Multisites?

    I want this site to have multi-authors (main purpose is to write posts) similar to other blogging sites for example hubpages etc... from the administrative point of view, the standard version is sufficient right?

    thanks,
    Will

  4. relativity98
    Member
    Posted 3 years ago #

    Hi Telos,

    Where do I insert this code? I am using WP 3.0.1, is it in the admin-functions.php?

    regards,
    Will

  5. relativity98
    Member
    Posted 3 years ago #

    It's ok. I found the function.php file.

    thanks,
    Will

  6. relativity98
    Member
    Posted 3 years ago #

    Hi Telos,

    I noticed in your previous discussions, a number of members also want to hide the comments and media tabs. Is this doable? Only to show their own comments and photos?

    Also, up the top Mine | All | Published | Draft | Trash can we do something about it? Only to show their own posts?

    Many thanks,
    Will

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.