Filter hook 'new_network_admin_email_content'

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

View Source

new_network_admin_email_content

Filter Hook
Description
Filters the text of the email sent when a change of network admin email address is attempted. The following strings have a special meaning and will get replaced dynamically: ###USERNAME### The current user's username. ###ADMIN_URL### The link to click on to confirm the email change. ###EMAIL### The proposed new network admin email address. ###SITENAME### The name of the network. ###SITEURL### The URL to the network. }

Hook Information

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

Hook Parameters

Type Name Description
string $email_text Text in the email.
array $new_admin_email { Data relating to the new network admin email address.

Usage Examples

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

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

Source Code Context

wp-includes/ms-functions.php:2835 - How this hook is used in WordPress core
<?php
2830  	 *
2831  	 *     @type string $hash     The secure hash used in the confirmation link URL.
2832  	 *     @type string $newemail The proposed new network admin email address.
2833  	 * }
2834  	 */
2835  	$content = apply_filters( 'new_network_admin_email_content', $email_text, $new_admin_email );
2836  
2837  	$current_user = wp_get_current_user();
2838  	$content      = str_replace( '###USERNAME###', $current_user->user_login, $content );
2839  	$content      = str_replace( '###ADMIN_URL###', esc_url( network_admin_url( 'settings.php?network_admin_hash=' . $hash ) ), $content );
2840  	$content      = str_replace( '###EMAIL###', $value, $content );

PHP Documentation

<?php
/**
	 * Filters the text of the email sent when a change of network admin email address is attempted.
	 *
	 * The following strings have a special meaning and will get replaced dynamically:
	 * ###USERNAME###  The current user's username.
	 * ###ADMIN_URL### The link to click on to confirm the email change.
	 * ###EMAIL###     The proposed new network admin email address.
	 * ###SITENAME###  The name of the network.
	 * ###SITEURL###   The URL to the network.
	 *
	 * @since 4.9.0
	 *
	 * @param string $email_text      Text in the email.
	 * @param array  $new_admin_email {
	 *     Data relating to the new network admin email address.
	 *
	 *     @type string $hash     The secure hash used in the confirmation link URL.
	 *     @type string $newemail The proposed new network admin email address.
	 * }
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/ms-functions.php
Related Hooks

Related hooks will be displayed here in future updates.