Closed tomislav13 closed 9 months ago
//this just worked for me
add_filter('groups_user_can', 'xxx_group_open_front_end', 100); function xxx_group_open_front_end($can_access) { if (is_admin()) { return $can_access; } return true; }
The groups_post_access_user_can_read_post
filter can be used returning true when !is_admin()
which would effectively override access protections on the frontend.
add_filter( 'groups_post_access_user_can_read_post', 'frontend_override_groups_post_access_user_can_read_post', 10, 3 );
function frontend_override_groups_post_access_user_can_read_post( $result, $post_id, $user_id ) {
if ( !is_admin() ) {
$result = true;
}
return $result;
}
@ash2osh your solution would open up any capability to the user on the frontend which would create a security issue
Hi, is there an option to disable this plugin on the frontend? I need it only in the backend, because everyone should see the website, but only specific users should edit(administer) certain parts of website. I made a workaround that seems to work by modifiying file lib/access/class-groups-post-access.php on few places, but is there an option to do this somewhere in plugin config?