SEOS THEMES

Free WordPress Themes

How to Show only author posts

How to Show only author posts in admin panel instead of all posts?
 

 

2 Comments so far:

  1. Еverything is so easily paste this code in functions.php

    function posts_for_current_author($query) {

    if($query->is_admin) {

    global $user_ID;
    $query->set(‘author’, $user_ID);

    $screen = get_current_screen();
    add_filter(‘views_’.$screen->id, ‘remove_post_counts’);
    }

    return $query;
    }
    add_filter(‘pre_get_posts’, ‘posts_for_current_author’);

    function remove_post_counts($posts_count_disp)
    {
    unset($posts_count_disp[‘all’]);
    unset($posts_count_disp[‘publish’]);

    return $posts_count_disp;
    }

Leave a Reply

^