Approval by Role
-
HI, this topic was originally created 1 year ago and it was marked “Resolved” but didn’t have any sort of resolution or answer to it. Your last response to the OP was an inquiry as to how he was registering people with user roles different than his site’s default role. He didn’t answer but the post was still marked resolved.
So I’d like to ask the same question. Can the approval process in your plugin be configured to moderate approvals for only 1 user role at registration?
In my BuddyPress registration form, I have a hidden dropdown select containing only one value which is the user role I want the user to register as. The role is different than the default role in my WordPress installation. I accomplish this by using the following code in my functions.php file:
///* 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); }
As it stands the plugin still forces Approval moderation for all users who register regardless of which user role is bestowed upon them during registration (I have multiple registration forms with different user roles based on different registration plugins).
https://www.ads-software.com/plugins/bp-registration-options/
- The topic ‘Approval by Role’ is closed to new replies.