Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- wp_generate_password returns password but can't login using it
- require_once( ABSPATH . WPINC . '/registration.php' );
- $user_pass = wp_generate_password();
- $userdata = array(
- 'user_pass' => $user_pass,
- 'user_login' => esc_attr( $_POST['user_email'] ),
- 'user_email' => esc_attr( $_POST['user_email'] ),
- );
- if( !$userdata['user_login'] )
- $error .= __('An Email Address is required for registration.', 'frontendprofile');
- elseif ( username_exists( $userdata['user_login'] ) )
- $error .= __('Sorry, that Email Address is already in use for another account.', 'frontendprofile');
- elseif ( !is_email( $userdata['user_email'] ) )
- $error .= __('You must enter a valid Email Address.', 'frontendprofile');
- elseif ( email_exists( $userdata['user_email'] ) )
- $error .= __('Sorry, that Email Address is already for another account.', 'frontendprofile');
- else{
- $new_user = wp_update_user( $userdata );
- }
Add Comment
Please, Sign In to add comment