I have a site with 3 different custom post types (Listings, Contacts, Events) and about 1600 'authors'. What I"m looking to do is only show that author their posts in the backend. So when authorA logs in, and clicks on 'Listings' then they only see their own.
I have this code running in Functions.php to control the first post type, but am not sure how to control the other two. The issue i'm seeing is that when authorA clicks on 'Events', their post that is in 'Listings' show up.
function __set_all_posts_for_author( &$query )
{
if ( $query->is_author )
$query->set( 'post_type', 'listings' );
remove_action( 'pre_get_posts', '__set_all_posts_for_author' ); // run once!
}
add_action( 'pre_get_posts', '__set_all_posts_for_author' );
So, i think i just need to change 'listings' to all three post types show up but i'm not sure how.... Any thoughts?