Filter hook 'user_request_action_email_content'

in WP Core File wp-includes/user.php at line 4895

View Source

user_request_action_email_content

Filter Hook
Description
Filters the text of the email sent when an account action is attempted. The following strings have a special meaning and will get replaced dynamically: ###DESCRIPTION### Description of the action being performed so the user knows what the email is for. ###CONFIRM_URL### The link to click on to confirm the account action. ###SITENAME### The name of the site. ###SITEURL### The URL to the site. }

Hook Information

File Location wp-includes/user.php View on GitHub
Hook Type Filter
Line Number 4895

Hook Parameters

Type Name Description
string $content Text in the email.
array $email_data { Data relating to the account action email.

Usage Examples

Basic Usage
<?php
// Hook into user_request_action_email_content
add_filter('user_request_action_email_content', 'my_custom_filter', 10, 2);

function my_custom_filter($content, $email_data) {
    // Your custom filtering logic here
    return $content;
}

Source Code Context

wp-includes/user.php:4895 - How this hook is used in WordPress core
<?php
4890  	 *     @type string          $confirm_url The link to click on to confirm the account action.
4891  	 *     @type string          $sitename    The site name sending the mail.
4892  	 *     @type string          $siteurl     The site URL sending the mail.
4893  	 * }
4894  	 */
4895  	$content = apply_filters( 'user_request_action_email_content', $content, $email_data );
4896  
4897  	$content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );
4898  	$content = str_replace( '###CONFIRM_URL###', sanitize_url( $email_data['confirm_url'] ), $content );
4899  	$content = str_replace( '###EMAIL###', $email_data['email'], $content );
4900  	$content = str_replace( '###SITENAME###', $email_data['sitename'], $content );

PHP Documentation

<?php
/**
	 * Filters the text of the email sent when an account action is attempted.
	 *
	 * The following strings have a special meaning and will get replaced dynamically:
	 *
	 * ###DESCRIPTION### Description of the action being performed so the user knows what the email is for.
	 * ###CONFIRM_URL### The link to click on to confirm the account action.
	 * ###SITENAME###    The name of the site.
	 * ###SITEURL###     The URL to the site.
	 *
	 * @since 4.9.6
	 *
	 * @param string $content Text in the email.
	 * @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: 2
  • File: wp-includes/user.php
Related Hooks

Related hooks will be displayed here in future updates.