WordPress.org

Make WordPress Core

Ticket #47004: 47004.patch

File 47004.patch, 8.6 KB (added by ramiy, 7 months ago)
  • wp-admin/includes/file.php

     
    23762376        /** This filter is documented in wp-includes/functions.php */
    23772377        $expiration      = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS );
    23782378        $expiration_date = date_i18n( get_option( 'date_format' ), time() + $expiration );
     2379        $email_address   = $request->email;
     2380        $export_file_url = get_post_meta( $request_id, '_export_file_url', true );
     2381        $site_name       = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
     2382        $site_url        = home_url();
    23792383
     2384        /* translators: Personal data export notification email subject. %s: Site title */
     2385        $subject = sprintf( __( '[%s] Personal Data Export' ), $site_name );
     2386
    23802387        /* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */
    23812388        $email_text = __(
    23822389                'Howdy,
     
    24092416         */
    24102417        $content = apply_filters( 'wp_privacy_personal_data_email_content', $email_text, $request_id );
    24112418
    2412         $email_address   = $request->email;
    2413         $export_file_url = get_post_meta( $request_id, '_export_file_url', true );
    2414         $site_name       = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    2415         $site_url        = home_url();
    2416 
    24172419        $content = str_replace( '###EXPIRATION###', $expiration_date, $content );
    24182420        $content = str_replace( '###LINK###', esc_url_raw( $export_file_url ), $content );
    24192421        $content = str_replace( '###EMAIL###', $email_address, $content );
     
    24202422        $content = str_replace( '###SITENAME###', $site_name, $content );
    24212423        $content = str_replace( '###SITEURL###', esc_url_raw( $site_url ), $content );
    24222424
    2423         $mail_success = wp_mail(
    2424                 $email_address,
    2425                 sprintf(
    2426                         /* translators: Personal data export notification email subject. %s: Site title */
    2427                         __( '[%s] Personal Data Export' ),
    2428                         $site_name
    2429                 ),
    2430                 $content
    2431         );
     2425        $mail_success = wp_mail( $email_address, $subject, $content );
    24322426
    24332427        if ( $switched_locale ) {
    24342428                restore_previous_locale();
  • wp-admin/includes/misc.php

     
    12391239
    12401240        $switched_locale = switch_to_locale( get_user_locale() );
    12411241
     1242        /* translators: New admin email address notification email subject. %s: Site title */
     1243        $subject = sprintf( __( '[%s] New Admin Email Address' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) );
     1244
    12421245        /* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */
    12431246        $email_text = __(
    12441247                'Howdy ###USERNAME###,
     
    12891292        $content      = str_replace( '###SITENAME###', wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $content );
    12901293        $content      = str_replace( '###SITEURL###', home_url(), $content );
    12911294
    1292         /* translators: New admin email address notification email subject. %s: Site title */
    1293         wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ), $content );
     1295        wp_mail( $value, $subject, $content );
    12941296
    12951297        if ( $switched_locale ) {
    12961298                restore_previous_locale();
  • wp-admin/includes/upgrade.php

     
    583583                $email     = $user->user_email;
    584584                $name      = $user->user_login;
    585585                $login_url = wp_login_url();
     586
     587                /* translators: New site notification email subject. %s: Site title */
     588                $subject = sprintf( __( '[%s] New WordPress Site' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) );
     589
    586590                /* translators: New site notification email. 1: New site URL, 2: User login, 3: User password or password reset link, 4: Login URL */
    587591                $message = sprintf(
    588592                        __(
     
    608612                        $login_url
    609613                );
    610614
    611                 @wp_mail( $email, __( 'New WordPress Site' ), $message );
     615                @wp_mail( $email, $subject, $message );
    612616        }
    613617endif;
    614618
  • wp-admin/ms-delete-site.php

     
    4646
    4747        $switched_locale = switch_to_locale( get_locale() );
    4848
     49        /* translators: Delete site confirmation notification email subject. %s: Site title */
     50        $subject = sprintf( __( '[%s] Delete My Site' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) );
     51
    4952        /* translators: Do not translate USERNAME, URL_DELETE, SITE_NAME: those are placeholders. */
    5053        $content = __(
    5154                "Howdy ###USERNAME###,
     
    7881        $content = str_replace( '###URL_DELETE###', $url_delete, $content );
    7982        $content = str_replace( '###SITE_NAME###', get_network()->site_name, $content );
    8083
    81         wp_mail( get_option( 'admin_email' ), '[ ' . wp_specialchars_decode( get_option( 'blogname' ) ) . ' ] ' . __( 'Delete My Site' ), $content );
     84        wp_mail( get_option( 'admin_email' ), $subject, $content );
    8285
    8386        if ( $switched_locale ) {
    8487                restore_previous_locale();
  • wp-admin/user-new.php

     
    112112
    113113                        $switched_locale = switch_to_locale( get_user_locale( $user_details ) );
    114114
     115                        /* translators: Joining confirmation notification email subject. %s: Site title */
     116                        $subject = sprintf( __( '[%s] Joining Confirmation' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) );
     117
    115118                        /* translators: 1: Site name, 2: site URL, 3: role, 4: activation URL */
    116119                        $message = __(
    117120                                'Hi,
     
    123126%4$s'
    124127                        );
    125128
    126                         /* translators: Joining confirmation notification email subject. %s: Site title */
    127                         wp_mail( $new_user_email, sprintf( __( '[%s] Joining Confirmation' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ) );
     129                        wp_mail( $new_user_email, $subject, sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ) );
    128130
    129131                        if ( $switched_locale ) {
    130132                                restore_previous_locale();
  • wp-includes/ms-functions.php

     
    25962596
    25972597        $switched_locale = switch_to_locale( get_user_locale() );
    25982598
     2599        /* translators: Email change notification email subject. %s: Network title */
     2600        $subject = sprintf( __( '[%s] Network Admin Email Change Request' ), wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES ) );
     2601
    25992602        /* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */
    26002603        $email_text = __(
    26012604                'Howdy ###USERNAME###,
     
    26452648        $content      = str_replace( '###SITENAME###', wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES ), $content );
    26462649        $content      = str_replace( '###SITEURL###', network_home_url(), $content );
    26472650
    2648         /* translators: Email change notification email subject. %s: Network title */
    2649         wp_mail( $value, sprintf( __( '[%s] Network Admin Email Change Request' ), wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES ) ), $content );
     2651        wp_mail( $value, $subject, $content );
    26502652
    26512653        if ( $switched_locale ) {
    26522654                restore_previous_locale();
  • wp-includes/user.php

     
    27612761
    27622762                $sitename = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    27632763
     2764                /* translators: Email change request notification email subject. %s: Site name */
     2765                $subject = sprintf( __( '[%s] Email Change Request' ), $sitename );
     2766
    27642767                /* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */
    27652768                $email_text = __(
    27662769                        'Howdy ###USERNAME###,
     
    28092812                $content = str_replace( '###SITENAME###', $sitename, $content );
    28102813                $content = str_replace( '###SITEURL###', home_url(), $content );
    28112814
    2812                 /* translators: New email address notification email subject. %s: Site name */
    2813                 wp_mail( $_POST['email'], sprintf( __( '[%s] Email Change Request' ), $sitename ), $content );
     2815                wp_mail( $_POST['email'], $subject, $content );
    28142816
    28152817                $_POST['email'] = $current_user->user_email;
    28162818        }