Change WordPress user roles and capabilities › Forums › Give user access to plugin – how to › Allow access to asset cleanup pro plugin › Reply To: Allow access to asset cleanup pro plugin
14/01/2021 at 14:47
#7268
Vladimir
Keymaster
Hi,
Thanks for the provided information. WPACU plugin uses ‘administrator’ role by default as the permission when defines its admin menu and checks current user permissions.
But it allows to replace ‘administrator’ with custom permission via filter. For example, code below provides access to WPACU plugin for any user with ‘manage_options’ capability:
add_filter('wpacu_access_role', 'replace_wpacu_admin_permission', 10, 1 );
function replace_wpacu_admin_permission( $cap ) {
$cap = 'manage_options';
return $cap;
}
You can add it to the functions.php file of your active theme.