Allowing a custom user role (shop_manager) with custom capabilities (manage_woocommerce) to access admin panel alng with instrcutors

Please add the given code in your wplms-customizer.php file in wplms customizer plugin :

add_filter('wplms_admin_access_capabilities','add_shop_manager');

function add_shop_manager($arr){

if(!is_user_logged_in())

return $arr;


if(current_user_can('manage_woocommerce')){

  array_unshift($arr[1],'manage_woocommerce');

unset($arr[1][1]);

}
   return $arr;


}

Note : in above code i added shop manager which have ” manage_woocommerce ” capability .You can change the ” manage_woocommerce ” with your custom capability .

Then please set the admin access from wp-admin -> wplms ->> buddypress ->wp admin access -> Instructors and administrators .

Leave a Reply

Your email address will not be published. Required fields are marked *