Filter hook 'wp_new_user_notification_email'

in WP Core File wp-includes/pluggable.php at line 2311

View Source

wp_new_user_notification_email

Filter Hook
Description
Filters the contents of the new user notification email sent to the new user. }

Hook Information

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

Hook Parameters

Type Name Description
array $wp_new_user_notification_email { Used to build wp_mail().
WP_User $user User object for new user.
string $blogname The site title.

Usage Examples

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

function my_custom_filter($wp_new_user_notification_email, $user, $blogname) {
    // Your custom filtering logic here
    return $wp_new_user_notification_email;
}

Source Code Context

wp-includes/pluggable.php:2311 - How this hook is used in WordPress core
<?php
2306  		 *     @type string $headers The headers of the email.
2307  		 * }
2308  		 * @param WP_User $user     User object for new user.
2309  		 * @param string  $blogname The site title.
2310  		 */
2311  		$wp_new_user_notification_email = apply_filters( 'wp_new_user_notification_email', $wp_new_user_notification_email, $user, $blogname );
2312  
2313  		wp_mail(
2314  			$wp_new_user_notification_email['to'],
2315  			wp_specialchars_decode( sprintf( $wp_new_user_notification_email['subject'], $blogname ) ),
2316  			$wp_new_user_notification_email['message'],

PHP Documentation

<?php
/**
		 * Filters the contents of the new user notification email sent to the new user.
		 *
		 * @since 4.9.0
		 *
		 * @param array   $wp_new_user_notification_email {
		 *     Used to build wp_mail().
		 *
		 *     @type string $to      The intended recipient - New user email address.
		 *     @type string $subject The subject of the email.
		 *     @type string $message The body of the email.
		 *     @type string $headers The headers of the email.
		 * }
		 * @param WP_User $user     User object for new user.
		 * @param string  $blogname The site title.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.