user_request_action_email_headers
Filter HookDescription
Filters the headers of the email sent when an account action is attempted. }Hook Information
File Location |
wp-includes/user.php
View on GitHub
|
Hook Type | Filter |
Line Number | 4925 |
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 user_request_action_email_headers
add_filter('user_request_action_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-includes/user.php:4925
- How this hook is used in WordPress core
<?php
4920 * @type string $confirm_url The link to click on to confirm the account action.
4921 * @type string $sitename The site name sending the mail.
4922 * @type string $siteurl The site URL sending the mail.
4923 * }
4924 */
4925 $headers = apply_filters( 'user_request_action_email_headers', $headers, $subject, $content, $request_id, $email_data );
4926
4927 $email_sent = wp_mail( $email_data['email'], $subject, $content, $headers );
4928
4929 if ( $switched_locale ) {
4930 restore_previous_locale();
PHP Documentation
<?php
/**
* Filters the headers of the email sent when an account action is attempted.
*
* @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 string $email The email address this is being sent to.
* @type string $description Description of the action being performed so the user knows what the email is for.
* @type string $confirm_url The link to click on to confirm the account action.
* @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-includes/user.php
Related Hooks
Related hooks will be displayed here in future updates.