WCML_Capabilities

The WooCommerce Multilingual WCML Capabilities class.

Defined (1)

The class is defined in the following location(s).

/inc/class-wcml-capabilities.php  
  1. class WCML_Capabilities{ 
  2.  
  3. public static function set_up_capabilities() { 
  4.  
  5. $role = get_role( 'administrator' ); 
  6. if($role) { 
  7. $role->add_cap( 'wpml_manage_woocommerce_multilingual' ); 
  8. $role->add_cap( 'wpml_operate_woocommerce_multilingual' ); 
  9.  
  10. $role = get_role( 'super_admin' ); 
  11. if($role) { 
  12. $role->add_cap( 'wpml_manage_woocommerce_multilingual' ); 
  13. $role->add_cap( 'wpml_operate_woocommerce_multilingual' ); 
  14.  
  15. $super_admins = get_super_admins(); 
  16. foreach ($super_admins as $admin) { 
  17. $user = new WP_User( $admin ); 
  18. $user->add_cap( 'wpml_manage_woocommerce_multilingual' ); 
  19. $user->add_cap( 'wpml_operate_woocommerce_multilingual' ); 
  20.  
  21. $role = get_role( 'shop_manager' ); 
  22. if($role) { 
  23. $role->add_cap( 'wpml_operate_woocommerce_multilingual' ); 
  24.  
  25.