show current authors post in wordpress admin panel

When you logged in to wordpress panel that time show only current authors post in wordpress admin panel. 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.

show current authors post in wordpress admin panel

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

show current authors post in wordpress admin panel
show current authors post in wordpress admin panel

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 purabtech.in.

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

4 thoughts on “show 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. 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.

Leave a Reply

Your email address will not be published.