network_admin_email_change_email
Filter HookDescription
Filters the contents of the email notification sent when the network admin email address is changed. The following strings have a special meaning and will get replaced dynamically: - ###OLD_EMAIL### The old network admin email address. - ###NEW_EMAIL### The new network admin email address. - ###SITENAME### The name of the network. - ###SITEURL### The URL to the site. }Hook Information
File Location |
wp-includes/ms-functions.php
View on GitHub
|
Hook Type | Filter |
Line Number | 2940 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$email_change_email
|
{ Used to build wp_mail(). |
string
|
$old_email
|
The old network admin email address. |
string
|
$new_email
|
The new network admin email address. |
int
|
$network_id
|
ID of the network. |
Usage Examples
Basic Usage
<?php
// Hook into network_admin_email_change_email
add_filter('network_admin_email_change_email', 'my_custom_filter', 10, 4);
function my_custom_filter($email_change_email, $old_email, $new_email, $network_id) {
// Your custom filtering logic here
return $email_change_email;
}
Source Code Context
wp-includes/ms-functions.php:2940
- How this hook is used in WordPress core
<?php
2935 * }
2936 * @param string $old_email The old network admin email address.
2937 * @param string $new_email The new network admin email address.
2938 * @param int $network_id ID of the network.
2939 */
2940 $email_change_email = apply_filters( 'network_admin_email_change_email', $email_change_email, $old_email, $new_email, $network_id );
2941
2942 $email_change_email['message'] = str_replace( '###OLD_EMAIL###', $old_email, $email_change_email['message'] );
2943 $email_change_email['message'] = str_replace( '###NEW_EMAIL###', $new_email, $email_change_email['message'] );
2944 $email_change_email['message'] = str_replace( '###SITENAME###', $network_name, $email_change_email['message'] );
2945 $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 network 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 network admin email address.
* - ###NEW_EMAIL### The new network admin email address.
* - ###SITENAME### The name of the network.
* - ###SITEURL### The URL to the site.
* @type string $headers Headers.
* }
* @param string $old_email The old network admin email address.
* @param string $new_email The new network admin email address.
* @param int $network_id ID of the network.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-includes/ms-functions.php
Related Hooks
Related hooks will be displayed here in future updates.