Filter hook 'wp_send_new_user_notification_to_admin'

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

View Source

wp_send_new_user_notification_to_admin

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

Hook Information

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

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_admin
add_filter('wp_send_new_user_notification_to_admin', '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:2193 - How this hook is used in WordPress core
<?php
2188  		 * @since 6.1.0
2189  		 *
2190  		 * @param bool    $send Whether to send the email. Default true.
2191  		 * @param WP_User $user User object for new user.
2192  		 */
2193  		$send_notification_to_admin = apply_filters( 'wp_send_new_user_notification_to_admin', true, $user );
2194  
2195  		if ( 'user' !== $notify && true === $send_notification_to_admin ) {
2196  
2197  			$admin_user = get_user_by( 'email', get_option( 'admin_email' ) );
2198  

PHP Documentation

<?php
/**
		 * Filters whether the admin is notified of a 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.