settings(); $settings->add_tab( 'users', __( 'Users', 'all-in-one-utilities' ), __( 'Settings that affect how user accounts are managed.', 'all-in-one-utilities' ), 20 ); $settings->add_section( 'users', 'user_roles', __( 'Multiple User Roles', 'all-in-one-utilities' ), __( 'Let a single user hold more than one role at once.', 'all-in-one-utilities' ), 20 ); $settings->add_field( 'users', 'user_roles', new Field( id: 'enabled', label: __( 'Enable Multiple User Roles', 'all-in-one-utilities' ), type: 'checkbox', default: 0, args: array( 'toggle_label' => __( 'Replace the single role dropdown with a roles checklist', 'all-in-one-utilities' ) ), doc: new Doc( title: __( 'Multiple User Roles', 'all-in-one-utilities' ), short: __( 'Lets any user hold several roles at once (e.g. Editor and Shop Manager).', 'all-in-one-utilities' ), detailed: __( 'Replaces WordPress\'s single-role dropdown on the Add New User, Edit User, and your-own-profile pages with a checklist, and replaces the Users list table\'s "Role" column with "Roles" showing all of them.', 'all-in-one-utilities' ), warnings: array( __( 'For safety, a user cannot change their own roles from their own profile page unless they are a network super admin -- this prevents accidentally locking yourself out.', 'all-in-one-utilities' ) ) ), priority: 10 ) ); if ( $settings->get_value( 'users', 'user_roles', 'enabled', 0 ) ) { ( new Feature() )->register(); } } }