Up to 50 percent off

Guest Post Auto user registration Roles

This topic contains 2 reply and 3 voices, and was last updated by Sekander Badsha 10 years ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
October 24, 2014 at 9:48 am 28997
Sekander Badsha Hello, I am using WPUF PRO. I know there is a setting to define the user role on a registration form, but there is no option to define the user role on a post form, (with guest post and auto user registration). I have read these forum topics: http://wedevs.com/support/topic/choose-user-type-on-registration/#post-2403 and http://wedevs.com/support/topic/change-user-role-on-registration/ But I want to define the user role without using a value from a custom field. I want to define the user role based on the post type being created (or based on the form ID being used, because I have one form for each post type) I tried something like: function wpufe_my_switch_reg( $args ) { if ( $_POST['post_type'] == 'house' ) { $args['role'] = 'subscriber'; } elseif ( $_POST['post_type'] == 'hotel' ) { $args['role'] = 'editor'; } return $args; } add_filter( 'wpuf_register_user_args', 'wpufe_my_switch_reg' ); But it's not working. Any help would be very much appreciated. Many thanks
October 26, 2014 at 3:58 pm 29074
Nayem Nayem

Hello V,

I need to discuss with our developer team about this. Please allow me some time.

Thank you 🙂

October 29, 2014 at 6:08 pm 29372
Sekander Badsha Sekander Badsha

Hello V,

They way your are trying is not correct. Only email or name can not register a user. To register an user, there is some must have some required fields. To get a idea about what parameters to pass, open up class/frontend-form-profile.php and go to line number 222. You will get idea about what to write.

Thank you 🙂

Viewing 2 Posts - 1 through 2 (of 2 total)