Change user role for WP-Members form
-
Hi there!
I’m trying to get this code to work:
add_action( 'wpmem_post_register_data', function( $fields ) { if ( wpmem_is_reg_type( 'wpmem' ) ) { wpmem_update_user_role( $fields['ID'], 'author' ); } });
What it should do is: set the user role of the registering user to ‘author’ IF the registration form is a wp-members registration form.
The script works except the if-statement. I also tried to replace ‘wpmem’ with ‘woo_checkout’ to see if that works, but it didn’t either.
Does someone know how to get this script to work?
Many thanks in advance!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Change user role for WP-Members form’ is closed to new replies.