Send a password to a user who has just registered for a member area
Send a password to a user who has just registered for a member area
Send a password to a user who has just registered for a member area
What I do, when I’m developing a plugin (or theme) on a local WordPress install and I’m feeling lazy, I just use a combination of var_dump($my_variable); die; // exit; works too This way I get an idea whats going on and I see when the variable stops being what I expect it to be. Another … Read more
Help hooking into user_register
I’m not entirely clear on what you’re trying to do, but it seems you want to pass the user’s email address via a query string and determine the user by that. You can get the user’s ID for writing user meta values from the email value. Use the function get_user_by() to retrieve the user object … Read more
When the user_register action is triggered, data from the registration form can be accessed in $_POST. Get first_name and last_name on user_register hook
You might put this code in functions.php : $GLOBALS[‘allowed_users’]= [‘mikejordan’, ‘jamesbrown’, …]; add_action(‘user_register’,’my_function’); function my_function($user_id){ // get user data $user_info = get_userdata($user_id); if ( in_array($user_info->login, $GLOBALS[‘allowed_users’] ) ) { $res = $wpdb->query($wpdb->prepare(“SELECT activation_key from {$wpdb->signups} WHERE user_login = %s)”, $user_info->login)); if (!empty($res)) { wpmu_activate_signup( $res->activation_key ); } } }
Single Sign On (SSO) between two WordPress websites
Register a user only to the root blog – WP Multisite
Use this snippet to create user without password $website = “http://example.com”; $userdata = array( ‘user_login’ => ‘login_name’, ‘user_url’ => $website, ‘user_pass’ => NULL // When creating an user, password is expected. ); $user_id = wp_insert_user( $userdata ) ; //after this you can update user on this way update_user_meta( $user_id, ‘some_meta_key’, $meta_value ); or //create user … Read more
I think you may try user_register hook for this purpose, because it gives you user’s id, which you need to add user meta. According to WP documentation: This action hook allows you to access data for a new user immediately after they are added to the database. The user id is passed to hook as … Read more