Adding multiple new user roles

Question

I found this code here: What action should I hook into when adding roles and capabilities?

add_action('after_setup_theme','my_add_role_function');

function my_add_role_function(){
    $roles_set = get_option('my_roles_are_set');
    if(!$roles_set){
        add_role('user_one', 'User One', array(
            'read' => true // True allows that capability, False specifically removes it.
        ));
        update_option('my_roles_are_set',true);
    }
}

How can I edit the code to add more user roles? User Two and User Three?

0
, , ACH 3 months 0 Answers 49 views 0

Leave an answer