show only current authors post in wordpress admin panel

Sponsors

When you logged in to wordpress panel that time you are able to see the all users post. I got requirement to show only current users post in admin panel. Because is there are lot of users in wordpress then you need search for your posts.

You just need to open the functions.php file from your wordpress theme folder and put following code in that file.


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

Note: If you are wordpress developer then only use this step or you can ask to do changes to any wordpress developer. If you face any issue then please write to me on wordpressapi@gmail.com. This article is written by wordpressapi.com.

Incoming search terms:

You may like following Articles!

11 thoughts on “show only current authors post in wordpress admin panel

  1. Hi,
    I need the advice. If you add the code to functions.php entire screen is white. Maybe I just put code in the wrong place do not know … Can you help me? thank you very much for your reply. …. I am using wordpress version 3.0.1.

  2. is_admin) {

    global $user_ID;
    $query->set(‘author’, $user_ID);
    }
    return $query;
    }
    add_filter(‘pre_get_posts’, ‘posts_for_current_author’);
    ?>

    but is plugin and admin dont see other post.

  3. Still have questions, how to change the number of contributions that were only for a specific author’s contribution over the top. (total, published, trash). Thank you very much. :)

  4. Hi, I’m trying to do the same thing that ask Jiri V., the number at the top of the table are still counting thw total amount of posts, I would like only to show the number of posts that has been written by the current user. I can’t find any filter or action about that. Someone could help me?
    Thanks…

  5. Thanks for this snippet. I had a guest blogger complain with me that there were many posts in draft status that were not published from other bloggers and wanted to know if their guest post would be published or not.

    BTW, the reason for me having many draft posts was that a particular blogger was submitting many posts for approval with similar content. I did contact the user to stop that practice and he has not done it again.

    This snippet will come in handy and appreciate you sharing it here with us.

  6. Monster has managed to combine style with functionality in the Dr Dre range of headphones. So often manufacturers sacrifice one for the other, but not here. Not only do they look good, but the sound quality is good too

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>