I have two editors(A and B), two authors(C and D). I want to assign author(C) to editor(A), and author(D) to editor(B).

So that the posts created by author(C) only editor(A) can view and posts created by author(D) only editor(B) can view. Also the posts created by editor(A) should not be visible to editor(B) and vice versa.

Can anyone help me how can I achieve this? Please help..I Need to solve this urgently.


1 Answer 1


This I have achieved without using any plugin. In admin I created custom field to fetch all the authors in the multiselect box. Here the editor can select as many author he wants. enter image description here

Then I added function in function.php file to fetch all the posts created by the current editor user and also by the author who falls under his category

add_action( 'pre_get_posts', 'wpcf_filter_author_posts' );
function wpcf_filter_author_posts( $query ){
    global $post_type, $pagenow;
    //if we are currently on the edit screen of the post type listings
    if($pagenow == 'edit.php' && $post_type == 'videos' && current_user_can('editor')){
        global $user_ID;
        $meta = get_user_meta( $user_ID );
        $selected_author_id = unserialize($meta['select_md'][0]);
        if(isset($selected_author_id) && !empty($selected_author_id)){
            $count = count($selected_author_id);
            $selected_author_id[$count] = $user_ID;
            $query->query_vars['author__in'] = $selected_author_id;
        } else {
            $query->query_vars['author'] = $user_ID;


And this is my post listing screen enter image description here

Here the author is Client3 and Promoter 1 is editor

  • sounds like a great idea but how did you create the custom field to fetch all the authors?
    – Florian
    Commented Aug 2, 2018 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.