Uploading/integrating custom user registration page
Uploading/integrating custom user registration page
Uploading/integrating custom user registration page
Try below code: add_action( ‘user_register’, ‘create_new_post_onuser_registration’, 10, 1 ); function create_new_post_onuser_registration( $user_id ){ // Get user info $user_meta = get_userdata( $user_id ); $user_roles = $user_meta->roles; // Update the role here if ( in_array( ‘subscriber’, $user_roles ) ) { // Do something. // Create a new post $subscriber_post = array( ‘post_title’ => $user_meta->nickname; ‘post_content’ => $user_meta->description, … Read more
you should do so: …} else { $site_url = get_site_url().”/myloginpage/”; $has_success = true; $message[] = “Successful registration”; global $wpdb; $key = $wpdb->get_row($wpdb->prepare(“SELECT ID,user_activation_key FROM $wpdb->users WHERE user_login = %s”,$usermobile)); add_user_meta($key->ID,’usermobilenum’,$usermobile); wp_set_current_user( $newUserID, $usermobile ); wp_set_auth_cookie( $newUserID ); //do_action( ‘wp_login’, $usermobile ); $redirecturl = site_url(‘/?signup=true&login=too’); wp_redirect( $redirecturl ); exit; } } } }
Yes, add the code in functions.php file of the activated theme.
I think this needs to live inside a plugin and not in functions.php How to turn off email you receive when registered?
Custom User Dashboard
In the documentation of WP REST User https://wordpress.org/plugins/wp-rest-user/ you have the aswer: To perform further actions after user is registered, write and add_action: add_action(‘wp_rest_user_user_register’, ‘user_registered’); function user_registered($user) { // Do Something } Replace “// Do Something” for the code to change the user role. Something like this (not tested): $u = new WP_User( 3 ); … Read more
With this plugin, you could add users from CSV file: https://wordpress.org/plugins/import-users-from-csv-with-meta/ You could use your mail list CSV and import it.
Using custom IDP with WP
Updated : how to make email optional while user registration using default wordpress form