SHARE
TWEET

Untitled

a guest Sep 4th, 2018 119 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. wp_generate_password returns password but can't login using it
  2. require_once( ABSPATH . WPINC . '/registration.php' );
  3. $user_pass = wp_generate_password();
  4. $userdata = array(
  5.   'user_pass' => $user_pass,
  6.   'user_login' => esc_attr( $_POST['user_email'] ),
  7.   'user_email' => esc_attr( $_POST['user_email'] ),
  8. );
  9.  
  10. if( !$userdata['user_login'] )
  11.   $error .= __('An Email Address is required for registration.', 'frontendprofile');
  12. elseif ( username_exists( $userdata['user_login'] ) )
  13.   $error .= __('Sorry, that Email Address is already in use for another account.', 'frontendprofile');
  14. elseif ( !is_email( $userdata['user_email'] ) )
  15.   $error .= __('You must enter a valid Email Address.', 'frontendprofile');
  16. elseif ( email_exists( $userdata['user_email'] ) )
  17.   $error .= __('Sorry, that Email Address is already for another account.', 'frontendprofile');
  18.  
  19. else{
  20.   $new_user = wp_update_user( $userdata );
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top