Filter hook 'wp_send_new_user_notification_to_user'

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

View Source

wp_send_new_user_notification_to_user

Filter Hook
Description
Filters whether the user is notified of their new user registration.

Hook Information

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

Hook Parameters

Type Name Description
bool $send Whether to send the email. Default true.
WP_User $user User object for new user.

Usage Examples

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

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

Source Code Context

wp-includes/pluggable.php:2258 - How this hook is used in WordPress core
<?php
2253  		 * @since 6.1.0
2254  		 *
2255  		 * @param bool    $send Whether to send the email. Default true.
2256  		 * @param WP_User $user User object for new user.
2257  		 */
2258  		$send_notification_to_user = apply_filters( 'wp_send_new_user_notification_to_user', true, $user );
2259  
2260  		// `$deprecated` was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notification.
2261  		if ( 'admin' === $notify || true !== $send_notification_to_user || ( empty( $deprecated ) && empty( $notify ) ) ) {
2262  			return;
2263  		}

PHP Documentation

<?php
/**
		 * Filters whether the user is notified of their new user registration.
		 *
		 * @since 6.1.0
		 *
		 * @param bool    $send Whether to send the email. Default true.
		 * @param WP_User $user User object for new user.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/pluggable.php
Related Hooks

Related hooks will be displayed here in future updates.