Changeset 43568 for trunk/src/wp-includes/user.php
- Timestamp:
- 08/13/2018 04:31:31 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r43477 r43568 3358 3358 * 3359 3359 * @param string $request_id ID of the request created via wp_create_user_request(). 3360 * @return WP_Error|bool Will return true/false based on the success of sending the email, or a WP_Error object.3360 * @return bool|WP_Error True on success, `WP_Error` on failure. 3361 3361 */ 3362 3362 function wp_send_user_request( $request_id ) { … … 3365 3365 3366 3366 if ( ! $request ) { 3367 return new WP_Error( 'user_request_error', __( 'Invalid request.' ) ); 3368 } 3367 return new WP_Error( 'invalid_request', __( 'Invalid user request.' ) ); 3368 } 3369 3370 // Localize message content for user; fallback to site default for visitors. 3371 if ( ! empty( $request->user_id ) ) { 3372 $locale = get_user_locale( $request->user_id ); 3373 } else { 3374 $locale = get_locale(); 3375 } 3376 3377 $switched_locale = switch_to_locale( $locale ); 3369 3378 3370 3379 $email_data = array( … … 3455 3464 $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data ); 3456 3465 3457 return wp_mail( $email_data['email'], $subject, $content ); 3466 $email_sent = wp_mail( $email_data['email'], $subject, $content ); 3467 3468 if ( $switched_locale ) { 3469 restore_previous_locale(); 3470 } 3471 3472 if ( ! $email_sent ) { 3473 return new WP_Error( 'privacy_email_error', __( 'Unable to send personal data export confirmation email.' ) ); 3474 } 3475 3476 return true; 3458 3477 } 3459 3478 … … 3505 3524 3506 3525 if ( ! $request ) { 3507 return new WP_Error( ' user_request_error', __( 'Invalid request.' ) );3526 return new WP_Error( 'invalid_request', __( 'Invalid request.' ) ); 3508 3527 } 3509 3528 … … 3592 3611 * @var int 3593 3612 */ 3594 3595 3613 public $user_id = 0; 3596 3614
Note: See TracChangeset
for help on using the changeset viewer.