Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $user_id = wp_insert_user( $user_data );
- $this->password = wp_generate_password(6, false);
- $user_data['user_pass'] = $this->password;
- function prepare_email(){
- $confirmation_to = $_REQUEST['email_address'];
- $confirmation_subject = 'Confirmation - Registration to My Site';
- $confirmation_message = 'Hi '.$_REQUEST['first_name'].',<br /></br />Thank you for registering with My Site. Your account has been set up and you can log in using the following details -<br /><br />'
- .'<strong>Username:</strong> '.$_REQUEST['username']
- .'<br /><strong>Password:</strong> '.$this->password
- .'<br /><br />Once you have logged in, please ensure that you visit the Site Admin and change you password so that you don't forget it in the future.';
- $headers = 'MIME-Version: 1.0'."rn";
- $headers.= 'Content-type: text/html; charset=iso-8859-1'."rn";
- $confirmation_headers = $headers.'From: My Site <no-reply@mysite.com>'."rn";
- $this->form_for_email = compact('confirmation_to', 'confirmation_subject', 'confirmation_message', 'confirmation_headers');
- }
- $user_id = wp_insert_user( $user_data );
- wp_new_user_notification( $user_id, $user_data->user_pass );
Add Comment
Please, Sign In to add comment