add_action('after_setup_theme', function () { if (!get_option('client_role_created')) { $administrator_caps = get_role('administrator')->capabilities; $caps_to_remove = [ 'switch_themes' => 1, 'edit_themes' => 1, 'update_themes' => 1, 'install_themes' => 1, // 'edit_theme_options' => 1, //widget, menu, ... 'delete_themes' => 1, 'activate_plugins' => 1, 'edit_plugins' => 1, 'update_plugins' => 1, 'delete_plugins' => 1, 'install_plugins' => 1, 'edit_users' => 1, 'delete_users' => 1, 'create_users' => 1, 'list_users' => 1, 'remove_users' => 1, 'promote_users' => 1, 'update_core' => 1, 'manage_options' => 1, 'unfiltered_upload' => 1, 'import' => 1, 'export' => 1, 'promote_users' => 1, ]; $client_admin_caps = array_diff_key($administrator_caps, $caps_to_remove); add_role('client_admin', 'Client Admin', $client_admin_caps); update_option('client_role_created', true); } }); add_action('after_setup_theme', function () { if (!get_option('client_role_created')) { $administrator_caps = get_role('administrator')->capabilities; $caps_to_remove = [ 'switch_themes' => 1, 'edit_themes' => 1, 'update_themes' => 1, 'install_themes' => 1, // 'edit_theme_options' => 1, //widget, menu, ... 'delete_themes' => 1, 'activate_plugins' => 1, 'edit_plugins' => 1, 'update_plugins' => 1, 'delete_plugins' => 1, 'install_plugins' => 1, 'edit_users' => 1, 'delete_users' => 1, 'create_users' => 1, 'list_users' => 1, 'remove_users' => 1, 'promote_users' => 1, 'update_core' => 1, 'manage_options' => 1, 'unfiltered_upload' => 1, 'import' => 1, 'export' => 1, 'promote_users' => 1, ]; $client_admin_caps = array_diff_key($administrator_caps, $caps_to_remove); add_role('client_admin', 'Client Admin', $client_admin_caps); update_option('client_role_created', true); } }); Connect
Fields marked with a * are required.

Connect

Your Name (required)

Your Email (required)

Subject

Your Message