{"id":1874,"date":"2024-12-26T12:48:59","date_gmt":"2024-12-26T11:48:59","guid":{"rendered":"https:\/\/wpmastertoolkit.com\/module\/roles-dutilisateurs-multiples\/"},"modified":"2025-01-08T16:55:36","modified_gmt":"2025-01-08T15:55:36","slug":"roles-dutilisateurs-multiples","status":"publish","type":"module","link":"https:\/\/wpmastertoolkit.com\/en\/module\/multiple-user-roles\/","title":{"rendered":"Multiple user roles"},"content":{"rendered":"<h1 class=\"wp-block-heading\">Multiple User Roles Module: Advanced User Role Management<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">In WordPress, each user can be assigned just one role at a time, limiting the flexibility of permissions management. However, in specific cases, such as with e-commerce or LMS (Learning Management System) plugins, the ability to assign multiple roles to a user becomes essential. That's why we've developed the <strong>Multiple User Roles<\/strong> in WPMasterToolKit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This module aims to simplify the assignment and management of multiple user roles directly from the WordPress administration interface, without having to install a third-party plugin or write code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Which plugins can the Multiple User Roles module replace?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The module <strong>Multiple User Roles<\/strong> can replace several popular WordPress plugins dedicated to advanced user role management, such as :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>User Role Editor<\/strong> used to modify roles and their permissions.<\/li>\n\n\n\n<li><strong>Members<\/strong> WPMasterToolKit: which offers similar functionality but with a more complex interface. With WPMasterToolKit, you benefit from an integrated, lightweight, high-performance solution.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">The module's main functions<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Adding multiple roles to a user<\/strong><br>With this module, you can assign multiple roles to a user when creating an account or modifying a profile. For example, a user can be both \"Author\" and \"Customer\" without conflict.<\/li>\n\n\n\n<li><strong>Intuitive interface<\/strong><br>The module adds a checkbox in the \"User profile\" section to select the roles to be assigned. This makes the process simple and accessible even for non-technical administrators.<\/li>\n\n\n\n<li><strong>Advanced permissions management<\/strong><br>This system supports custom roles defined by other plugins such as WooCommerce (\"Customer\" or \"Shop Manager\" roles) or LMS platforms (\"Instructor\", \"Student\" roles, etc.).<\/li>\n\n\n\n<li><strong>Compatible with editable roles<\/strong><br>The module ensures that only roles that can be modified by the current administrator are available, by using the native function <code data-no-auto-translation=\"\">get_editable_roles()<\/code> from WordPress.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">How do I use the \"Multiple User Roles\" module?<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Module activation<\/strong><br>Once the module has been activated via the WPMasterToolKit interface, you can start using it straight away.<\/li>\n\n\n\n<li><strong>Assigning roles to an existing user<\/strong>\n<ul class=\"wp-block-list\">\n<li>Go to the edit user profile page in WordPress.<\/li>\n\n\n\n<li>A new \"Roles\" section appears, displaying a list of available roles.<\/li>\n\n\n\n<li>Select or deselect the roles you wish to assign to the user.<\/li>\n\n\n\n<li>Save changes.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Assigning roles to a new user<\/strong>\n<ul class=\"wp-block-list\">\n<li>When creating a new user, the same interface will be available for assigning multiple roles, even before saving the user.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Deleting and updating roles<\/strong>\n<ul class=\"wp-block-list\">\n<li>Deselected roles will be automatically removed from the user, and newly selected roles will be added.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img alt=\"WordPress interface with selected user roles.\" fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"405\" src=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-126-1024x405.png\" class=\"wp-image-3820\" srcset=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-126-1024x405.png 1024w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-126-300x119.png 300w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-126-768x304.png 768w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-126.png 1118w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">The technical choices behind the module<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Using native WordPress actions<\/strong><br>The module uses several native WordPress hooks to integrate its functionality, including :\n<ul class=\"wp-block-list\">\n<li><code data-no-auto-translation=\"\">show_user_profile<\/code> and <code data-no-auto-translation=\"\">edit_user_profile<\/code> to display the roles section of the user interface.<\/li>\n\n\n\n<li><code data-no-auto-translation=\"\">personal_options_update<\/code> and <code data-no-auto-translation=\"\">edit_user_profile_update<\/code> to save changes.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Secure validation with nonces<\/strong><br>To protect data against CSRF attacks, the module uses a <strong>nonce WordPress<\/strong> in each form.<\/li>\n\n\n\n<li><strong>Conditional registration of scripts and styles<\/strong><br>Module-specific scripts and styles are only loaded on the relevant administration pages (for example, <code data-no-auto-translation=\"\">user-edit.php<\/code> and <code data-no-auto-translation=\"\">user-new.php<\/code>), optimizing performance.<\/li>\n\n\n\n<li><strong>Role management with native functions<\/strong><br>Roles are assigned and deleted using native WordPress functions <code data-no-auto-translation=\"\">add_role<\/code> and <code data-no-auto-translation=\"\">remove_role<\/code>for maximum compatibility with third-party plug-ins.<\/li>\n\n\n\n<li><strong>User data filtering<\/strong><br>Prior to any modification, the module cleans and validates incoming data using functions such as <code data-no-auto-translation=\"\">wpmastertoolkit_clean<\/code> to guarantee the integrity of assigned roles.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The module <strong>Multiple User Roles<\/strong> is an elegant, high-performance solution for WordPress administrators looking for advanced user role management. Replacing often complex or cumbersome third-party plugins, this module integrated into WPMasterToolKit is part of a minimalist, high-performance approach focused on real user needs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whether you manage an online store, an educational site or a community, this module simplifies your daily tasks when it comes to managing roles and permissions. Take advantage of this feature today by simply activating the module in your WPMasterToolKit dashboard!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>","protected":false},"excerpt":{"rendered":"<p>WPMasterToolKit's Multiple User Roles module enables advanced user role management in WordPress, allowing multiple roles to be assigned to a user. Designed for complex sites, it can replace plugins such as User Role Editor or Members, reducing plugin overload. Simple to use, it makes it easy to manage rights and access via an intuitive interface. The module optimizes performance by loading only the necessary scripts, and ensures the security of actions thanks to integrated controls. It's a flexible solution for efficient user role management.<\/p>","protected":false},"featured_media":0,"parent":0,"template":"","meta":{"_acf_changed":true,"_seopress_titles_title":"Gestion avanc\u00e9e des r\u00f4les utilisateurs sous WordPress","_seopress_titles_desc":"G\u00e9rez plusieurs r\u00f4les utilisateur facilement avec WPMasterToolKit. Simplifiez la gestion des permissions dans WordPress sans plugins suppl\u00e9mentaires.","_seopress_robots_index":"","_seopress_robots_follow":"","_seopress_robots_imageindex":"","_seopress_robots_snippet":"","_seopress_robots_primary_cat":"","_seopress_robots_breadcrumbs":"","_seopress_robots_freeze_modified_date":"","_seopress_robots_custom_modified_date":"","_seopress_robots_canonical":"","_seopress_social_fb_title":"","_seopress_social_fb_desc":"","_seopress_social_fb_img":"","_seopress_social_fb_img_attachment_id":0,"_seopress_social_fb_img_width":0,"_seopress_social_fb_img_height":0,"_seopress_social_twitter_title":"","_seopress_social_twitter_desc":"","_seopress_social_twitter_img":"","_seopress_social_twitter_img_attachment_id":0,"_seopress_social_twitter_img_width":0,"_seopress_social_twitter_img_height":0,"_seopress_redirections_value":"","_seopress_redirections_enabled":"","_seopress_redirections_enabled_regex":"","_seopress_redirections_logged_status":"both","_seopress_redirections_param":"","_seopress_redirections_type":301,"_seopress_analysis_target_kw":"","_surecart_dashboard_logo_width":"180px","_surecart_dashboard_show_logo":true,"_surecart_dashboard_navigation_orders":true,"_surecart_dashboard_navigation_invoices":true,"_surecart_dashboard_navigation_subscriptions":true,"_surecart_dashboard_navigation_downloads":true,"_surecart_dashboard_navigation_billing":true,"_surecart_dashboard_navigation_account":true},"class_list":["post-1874","module","type-module","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module\/1874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module"}],"about":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/types\/module"}],"wp:attachment":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/media?parent=1874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}