MainWP Community

Support for WooCommerce user roles?

Hi, does anyone know if there is support for custom roles? For example I am running multiple WooCommerce sites and I need to create a new “Shop Manager” on each site. When I want to do that from my MainWP I see only default WordPress roles supported.

Thanks

Hey @terrence_covin, yeah, by default MainWP includes only default WP user roles, but the plugin provides the mainwp-users-manage-roles filter that you can use to add support for any custom role. For example, to add “Shop Manager”, you can simply add this snippet to your dashboard:

add_filter( 'mainwp-users-manage-roles', 'mycustom_mainwp_users_manage_roless' );
function mycustom_mainwp_users_manage_roless( $roles ) { 
   $roles['shop_manager']  = 'Shop manager'; 
    return $roles;    
}

You can use the MainWP Custom Dashboard Extension to apply this filter.

3 Likes

@terrence_covin If you are looking for a way to create that role you may use this plugin and couple it with @bogdan’s solution https://wordpress.org/plugins/user-role-editor/

1 Like

That worked perfectly! Thanks!

3 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.