WordPress.org

Make WordPress Core

Ticket #43985: 43985.diff

File 43985.diff, 1.1 KB (added by desrosj, 20 months ago)
  • src/wp-includes/user.php

     
    30753075                return new WP_Error( 'user_request_error', __( 'Invalid request.' ) );
    30763076        }
    30773077
     3078        $switched_locale = false;
     3079        if ( ! empty( $request->user_id ) ) {
     3080                $switched_locale = switch_to_locale( get_user_locale( $request->user_id ) );
     3081        }
     3082
    30783083        $email_data = array(
    30793084                'email'       => $request->email,
    30803085                'description' => wp_user_request_action_description( $request->action_name ),
     
    31423147        $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
    31433148
    31443149        /* translators: %s Site name. */
    3145         return wp_mail( $email_data['email'], sprintf( __( '[%s] Confirm Action' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ), $content );
     3150        $result = wp_mail( $email_data['email'], sprintf( __( '[%s] Confirm Action' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ), $content );
     3151
     3152        if ( $switched_locale ) {
     3153                restore_current_locale();
     3154        }
     3155
     3156        return $result;
    31463157}
    31473158
    31483159/**