Skip Navigation

[Resolved] Toolset ACCESS behaving oddly

This support ticket is created 4 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 1 voice.

Last updated by pedro.S 4 years, 5 months ago.

Author
Posts
#1677723

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.

#1677757

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