• I register user with role, But this is not possible for me (if there anyone know answer share).

    My requirement is role based account confirmation approval. Using below code.

    Register used,
    wp_create_user( $user_name, $random_password, $user_email );
    After user create updated role like below,
    $user_id_role = new WP_User($user_id);
    $user_id_role->set_role(‘subscriber’);

    I enabled anyone can register checkbox in wp-admin and default role is “Author”. So when user create in author role and after update as a subscriber.

    For auto account approval I used add_action( ‘user_register’, ‘myplugin_registration_save’, 10, 1 );

    So when user register the role comes as author not a subscriber.

    If I use add_action(‘edit_user_profile_update’, ‘update_extra_profile_fields’); each time profile update auto approval will happen. So i could not use this hook

    There is any other option?.

Viewing 1 replies (of 1 total)
  • Hey Im not sure Im following this bit

    My requirement is role based account confirmation approval.

    A user registers on the site and is made Author by default. What exactly are we trying to achieve at this point ?

Viewing 1 replies (of 1 total)
  • The topic ‘User register with the role’ is closed to new replies.