Change WordPress user roles and capabilities › Forums › Give user access to plugin – how to › WooCommerce product search redirected back to dashboard › Reply To: WooCommerce product search redirected back to dashboard
>> I want to give them all the access but im restricting the functions via the ADMIN MENU if that make sense.
Good point. I see that the latest update in this part excluded users with “delete_users” capability from the scope of “Admin access menu” and other add-ons because of WordPress’s built-in is_super_admin() function counts them as superadmin users under single site WordPress.
I will rollback this change with a next update. For the time being you may replace is_super_admin() method in the includes/classes/ure-lib.php file with this version:
/**
* Returns true if user has a real super administrator permissions
* It takes into account $this->raised_permissions value, in order do not count a user with temporally raised permissions
* of a real superadmin under WP Multisite
* For WP Singlesite superadmin is a user with 'administrator' role only in opposite the WordPress's is_super_admin(),
* which counts any user with 'delete_users' capability as a superadmin.
*
* @param int $user_id
* @global WP_User $current_user
* @return boolean
*/
public function is_super_admin($user_id = false) {
if (empty($user_id)) {
$user = wp_get_current_user();
$user_id = $user->ID;
} else {
$user = get_userdata($user_id);
}
if (!$user || !$user->exists()) {
return false;
}
if ($this->multisite && !$this->raised_permissions && is_super_admin($user_id)) {
return true;
}
if (!$this->multisite && $this->user_has_capability($user, 'administrator')) {
return true;
}
return false;
}
// end of is_super_admin()