• Resolved jimario

    (@jimario)


    The title of my post is similar to another but the issue is different. Right now when I use your plugin everything works as expected. There are other similar plugins but this one I think is the best.

    However, I need it to limit Approval moderation to a specific user role. As it stands now, anyone who registers is covered by Approval moderation. My site is set up so that 1 type of user role that is registered must wait until their account is “approved”. The other type of user role that registers on another registration form receives the actual activation link to activate their account.

    What I’d like your plugin to do is disregard users that activate their accounts via the activation link. Another way to put is maybe this plugin can automatically approve those accounts which are activated by the link rather than by the administrator.

    Is this possible with your plugin?

    This is how I’m successfully forcing a specific user role (different than the default) at registration in my registration form: I have a hidden dropdown select with only one value containing the name of the user role I want the registrant to have. In my functions.php file I have the following code:

    ///* this forces "female" user role at registration via a hidden radio field on the buddypress registration form *//
    add_action('bp_core_activated_user', 'bp_custom_registration_role',10 , 3);
    function bp_custom_registration_role($user_id, $key, $user) {
       $userdata = array();
       $userdata['ID'] = $user_id;
       $userdata['role'] = xprofile_get_field_data('Gender', $user_id);
    
       if ($userdata['role'] == 'Female')
          $userdata['role'] = 'female';
          //only allow if user role is my_role
       if (($userdata['role'] == "female"))
          wp_update_user($userdata);
    
      }

    https://www.ads-software.com/plugins/new-user-approve/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Target approval for specific user role’ is closed to new replies.