wp_privacy_personal_data_email_headers
Filter HookDescription
Filters the headers of the email sent with a personal data export file. to the value of `$request->email`, but can be changed by the `wp_privacy_personal_data_email_to` filter. }Hook Information
File Location |
wp-admin/includes/privacy-tools.php
View on GitHub
|
Hook Type | Filter |
Line Number | 737 |
Hook Parameters
Type | Name | Description |
---|---|---|
string|array
|
$headers
|
The email headers. |
string
|
$subject
|
The email subject. |
string
|
$content
|
The email content. |
int
|
$request_id
|
The request ID. |
array
|
$email_data
|
{ Data relating to the account action email. |
Usage Examples
Basic Usage
<?php
// Hook into wp_privacy_personal_data_email_headers
add_filter('wp_privacy_personal_data_email_headers', 'my_custom_filter', 10, 5);
function my_custom_filter($headers, $subject, $content, $request_id, $email_data) {
// Your custom filtering logic here
return $headers;
}
Source Code Context
wp-admin/includes/privacy-tools.php:737
- How this hook is used in WordPress core
<?php
732 * @type string $export_file_url The export file URL.
733 * @type string $sitename The site name sending the mail.
734 * @type string $siteurl The site URL sending the mail.
735 * }
736 */
737 $headers = apply_filters( 'wp_privacy_personal_data_email_headers', $headers, $subject, $content, $request_id, $email_data );
738
739 $mail_success = wp_mail( $request_email, $subject, $content, $headers );
740
741 if ( $switched_locale ) {
742 restore_previous_locale();
PHP Documentation
<?php
/**
* Filters the headers of the email sent with a personal data export file.
*
* @since 5.4.0
*
* @param string|array $headers The email headers.
* @param string $subject The email subject.
* @param string $content The email content.
* @param int $request_id The request ID.
* @param array $email_data {
* Data relating to the account action email.
*
* @type WP_User_Request $request User request object.
* @type int $expiration The time in seconds until the export file expires.
* @type string $expiration_date The localized date and time when the export file expires.
* @type string $message_recipient The address that the email will be sent to. Defaults
* to the value of `$request->email`, but can be changed
* by the `wp_privacy_personal_data_email_to` filter.
* @type string $export_file_url The export file URL.
* @type string $sitename The site name sending the mail.
* @type string $siteurl The site URL sending the mail.
* }
*/
Quick Info
- Hook Type: Filter
- Parameters: 5
- File: wp-admin/includes/privacy-tools.php
Related Hooks
Related hooks will be displayed here in future updates.