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 .

Was this article helpful?

Related Articles

2 Comments

  1. stef

    After updating, i lost my wplms_customizer.
    And the solution above does not work anymore

    st

    1. stef

      My mistake,
      The customization is still there. However, those filter does not work.
      thanks
      st

Leave A Comment?