Viewing 1 replies (of 1 total)
  • Plugin Author Caseproof

    (@caseproof)

    Hi @weblancerfr

    Here is simple example how to assign user to custom role:

    $user = new WP_User(123); // 123 is the user ID
    $user->add_role('sample_role'); // sample_role is the slug of your role

    Cheers

Viewing 1 replies (of 1 total)
  • The topic ‘Code php for assign user to role’ is closed to new replies.