Make WordPress Core

Changeset 43450


Ignore:
Timestamp:
07/16/2018 12:08:11 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Privacy: add user request type to the admin notification email subject.

Merges [43375] to the 4.9 branch.
Props birgire, desrosj.
Fixes #44099.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/user.php

    r43368 r43450  
    28962896    }
    28972897
    2898     $subject = sprintf(
    2899         /* translators: %s Site name. */
    2900         __( '[%s] Action Confirmed' ),
    2901         wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
    2902     );
    2903 
    2904     $manage_url = add_query_arg( 'page', $request_data->action_name, admin_url( 'tools.php' ) );
     2898    $manage_url         = add_query_arg( 'page', $request_data->action_name, admin_url( 'tools.php' ) );
     2899    $action_description = wp_user_request_action_description( $request_data->action_name );
    29052900
    29062901    /**
     
    29232918        'request'     => $request_data,
    29242919        'user_email'  => $request_data->email,
    2925         'description' => wp_user_request_action_description( $request_data->action_name ),
     2920        'description' => $action_description,
    29262921        'manage_url'  => $manage_url,
    29272922        'sitename'    => get_option( 'blogname' ),
     
    29812976    $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content );
    29822977    $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
     2978
     2979    $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
     2980
     2981    $subject = sprintf(
     2982        /* translators: 1: Site name. 2: Name of the confirmed action. */
     2983        __( '[%1$s] Action Confirmed: %2$s' ),
     2984        $blogname,
     2985        $action_description
     2986    );
     2987
     2988    /**
     2989     * Filters the subject of the user request confirmation email.
     2990     *
     2991     * @since 4.9.7
     2992     *
     2993     * @param string $subject    The email subject.
     2994     * @param string $blogname   The name of the site.
     2995     * @param array  $email_data {
     2996     *     Data relating to the account action email.
     2997     *
     2998     *     @type WP_User_Request $request     User request object.
     2999     *     @type string          $user_email  The email address confirming a request
     3000     *     @type string          $description Description of the action being performed so the user knows what the email is for.
     3001     *     @type string          $manage_url  The link to click manage privacy requests of this type.
     3002     *     @type string          $sitename    The site name sending the mail.
     3003     *     @type string          $siteurl     The site URL sending the mail.
     3004     *     @type string          $admin_email The administrator email receiving the mail.
     3005     * }
     3006     */
     3007    $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $blogname, $email_data );
    29833008
    29843009    $email_sent = wp_mail( $email_data['admin_email'], $subject, $content );
Note: See TracChangeset for help on using the changeset viewer.