Filter hook 'site_admin_email_change_email'

in WP Core File wp-includes/functions.php at line 8161

View Source

site_admin_email_change_email

Filter Hook
Description
Filters the contents of the email notification sent when the site admin email address is changed. The following strings have a special meaning and will get replaced dynamically: - ###OLD_EMAIL### The old site admin email address. - ###NEW_EMAIL### The new site admin email address. - ###SITENAME### The name of the site. - ###SITEURL### The URL to the site. }

Hook Information

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

Hook Parameters

Type Name Description
array $email_change_email { Used to build wp_mail().
string $old_email The old site admin email address.
string $new_email The new site admin email address.

Usage Examples

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

function my_custom_filter($email_change_email, $old_email, $new_email) {
    // Your custom filtering logic here
    return $email_change_email;
}

Source Code Context

wp-includes/functions.php:8161 - How this hook is used in WordPress core
<?php
8156  	 *     @type string $headers Headers.
8157  	 * }
8158  	 * @param string $old_email The old site admin email address.
8159  	 * @param string $new_email The new site admin email address.
8160  	 */
8161  	$email_change_email = apply_filters( 'site_admin_email_change_email', $email_change_email, $old_email, $new_email );
8162  
8163  	$email_change_email['message'] = str_replace( '###OLD_EMAIL###', $old_email, $email_change_email['message'] );
8164  	$email_change_email['message'] = str_replace( '###NEW_EMAIL###', $new_email, $email_change_email['message'] );
8165  	$email_change_email['message'] = str_replace( '###SITENAME###', $site_name, $email_change_email['message'] );
8166  	$email_change_email['message'] = str_replace( '###SITEURL###', home_url(), $email_change_email['message'] );

PHP Documentation

<?php
/**
	 * Filters the contents of the email notification sent when the site admin email address is changed.
	 *
	 * @since 4.9.0
	 *
	 * @param array $email_change_email {
	 *     Used to build wp_mail().
	 *
	 *     @type string $to      The intended recipient.
	 *     @type string $subject The subject of the email.
	 *     @type string $message The content of the email.
	 *         The following strings have a special meaning and will get replaced dynamically:
	 *         - ###OLD_EMAIL### The old site admin email address.
	 *         - ###NEW_EMAIL### The new site admin email address.
	 *         - ###SITENAME###  The name of the site.
	 *         - ###SITEURL###   The URL to the site.
	 *     @type string $headers Headers.
	 * }
	 * @param string $old_email The old site admin email address.
	 * @param string $new_email The new site admin email address.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/functions.php
Related Hooks

Related hooks will be displayed here in future updates.