Changeset 59460
- Timestamp:
- 11/26/2024 10:01:08 AM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-automatic-updater.php
r59159 r59460 937 937 } 938 938 939 $admin_user = get_user_by( 'email', get_site_option( 'admin_email' ) ); 940 941 if ( $admin_user ) { 942 $switched_locale = switch_to_user_locale( $admin_user->ID ); 943 } else { 944 $switched_locale = switch_to_locale( get_locale() ); 945 } 946 939 947 switch ( $type ) { 940 948 case 'success': // We updated. … … 1140 1148 1141 1149 wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] ); 1150 1151 if ( $switched_locale ) { 1152 restore_previous_locale(); 1153 } 1142 1154 } 1143 1144 1155 1145 1156 /** … … 1254 1265 return; 1255 1266 } 1267 } 1268 1269 $admin_user = get_user_by( 'email', get_site_option( 'admin_email' ) ); 1270 1271 if ( $admin_user ) { 1272 $switched_locale = switch_to_user_locale( $admin_user->ID ); 1273 } else { 1274 $switched_locale = switch_to_locale( get_locale() ); 1256 1275 } 1257 1276 … … 1527 1546 update_option( 'auto_plugin_theme_update_emails', $past_failure_emails ); 1528 1547 } 1548 1549 if ( $switched_locale ) { 1550 restore_previous_locale(); 1551 } 1529 1552 } 1530 1553 … … 1535 1558 */ 1536 1559 protected function send_debug_email() { 1537 $update_count = 0; 1538 foreach ( $this->update_results as $type => $updates ) { 1539 $update_count += count( $updates ); 1560 $admin_user = get_user_by( 'email', get_site_option( 'admin_email' ) ); 1561 1562 if ( $admin_user ) { 1563 $switched_locale = switch_to_user_locale( $admin_user->ID ); 1564 } else { 1565 $switched_locale = switch_to_locale( get_locale() ); 1540 1566 } 1541 1567 … … 1716 1742 1717 1743 wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] ); 1744 1745 if ( $switched_locale ) { 1746 restore_previous_locale(); 1747 } 1718 1748 } 1719 1749
Note: See TracChangeset
for help on using the changeset viewer.