- return true;
-}
-
-/**
- * register_new_user() - Handles registering a new user
- *
- * {@internal Missing Long Description}}
- *
- * @param string $user_login User's username for logging in
- * @param string $user_email User's email address to send password and add
- * @return int|WP_Error Either user's ID or error on failure.
- */
-function register_new_user($user_login, $user_email) {
- $errors = new WP_Error();
-
- $user_login = sanitize_user( $user_login );
- $user_email = apply_filters( 'user_registration_email', $user_email );
-
- // Check the username
- if ( $user_login == '' )
- $errors->add('empty_username', __('<strong>ERROR</strong>: Please enter a username.'));
- elseif ( !validate_username( $user_login ) ) {
- $errors->add('invalid_username', __('<strong>ERROR</strong>: This username is invalid. Please enter a valid username.'));
- $user_login = '';
- } elseif ( username_exists( $user_login ) )
- $errors->add('username_exists', __('<strong>ERROR</strong>: This username is already registered, please choose another one.'));
-
- // Check the e-mail address
- if ($user_email == '') {
- $errors->add('empty_email', __('<strong>ERROR</strong>: Please type your e-mail address.'));
- } elseif ( !is_email( $user_email ) ) {
- $errors->add('invalid_email', __('<strong>ERROR</strong>: The email address isn’t correct.'));
- $user_email = '';
- } elseif ( email_exists( $user_email ) )
- $errors->add('email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.'));
-
- do_action('register_post', $user_login, $user_email, $errors);
-
- $errors = apply_filters( 'registration_errors', $errors );
-
- if ( $errors->get_error_code() )
- return $errors;
-
- $user_pass = wp_generate_password();
- $user_id = wp_create_user( $user_login, $user_pass, $user_email );
- if ( !$user_id ) {
- $errors->add('registerfail', sprintf(__('<strong>ERROR</strong>: Couldn’t register you... please contact the <a href="mailto:%s">webmaster</a> !'), get_option('admin_email')));
- return $errors;
- }
+ $message = __('Someone requested that the password be reset for the following account:') . "\r\n\r\n";
+ $message .= network_home_url( '/' ) . "\r\n\r\n";
+ $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
+ $message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n";
+ $message .= __('To reset your password, visit the following address:') . "\r\n\r\n";
+ $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";