Guest User

Untitled

a guest
Jun 14th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. $user_id = wp_insert_user( $user_data );
  2.  
  3. $this->password = wp_generate_password(6, false);
  4. $user_data['user_pass'] = $this->password;
  5.  
  6. function prepare_email(){
  7.  
  8. $confirmation_to = $_REQUEST['email_address'];
  9. $confirmation_subject = 'Confirmation - Registration to My Site';
  10. $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 />'
  11. .'<strong>Username:</strong> '.$_REQUEST['username']
  12. .'<br /><strong>Password:</strong> '.$this->password
  13. .'<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.';
  14. $headers = 'MIME-Version: 1.0'."rn";
  15. $headers.= 'Content-type: text/html; charset=iso-8859-1'."rn";
  16. $confirmation_headers = $headers.'From: My Site <no-reply@mysite.com>'."rn";
  17.  
  18. $this->form_for_email = compact('confirmation_to', 'confirmation_subject', 'confirmation_message', 'confirmation_headers');
  19.  
  20. }
  21.  
  22. $user_id = wp_insert_user( $user_data );
  23. wp_new_user_notification( $user_id, $user_data->user_pass );
Add Comment
Please, Sign In to add comment