Hi,
I have 2 custom post types and both are behaving differently in the admin for a specific user role. These custom post types are "Reports" and "Programs".
Admin area has 2 access groups ->" Administrator" and "Members or partners of the project"
Members or partners user role should be able to see only the content they created.
What is happening is that for the same user role the custom post types are behaving differently. Having set the permissions the same for both custom post types.
This is also happening to other content custo types like Posts and Events, only Reports is working correctly (i see the content i create).
I have provided the admin access in case you need it to check whats wrong on another post (Chris has access to it). This is the post: https://toolset.com/forums/topic/access-administrator-not-viewing-all-posts/
A backup has been made.
I have some functions in functions.php to hide specific content on the backoffice for "Members or partners" user role, but that should not interfer because in one custom post type i can see... and on another i can't. If it would affect i would not see at all.
Thanks.
My issue is resolved now. Thank you!
To those who need here is the code for functions.php to show only the content the user created in the wordpress admin:
add_action('pre_get_posts', 'query_set_only_author' );
function query_set_only_author( $wp_query ) {
global $current_user;
if( is_admin() && !current_user_can('edit_others_posts') ) {
$wp_query->set( 'author', $current_user->ID );
add_filter('views_edit-post', 'fix_post_counts');
add_filter('views_upload', 'fix_media_counts');
}
}