$send_notification_to_user =
apply_filters( 'wp_send_new_user_notification_to_user', true,
$user );
// `$deprecated` was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notification.
if ( 'admin' ===
$notify || true !==
$send_notification_to_user || ( empty( $deprecated ) &&
empty( $notify ) ) ) { return;
} $key =
get_password_reset_key( $user );
if ( is_wp_error( $key ) ) { return;
} $switched_locale =
switch_to_user_locale( $user_id );
/* translators: %s: User login. */
$message =
sprintf( __( 'Username: %s'
),
$user->user_login
) . "\r\n\r\n";
$message .=
__( 'To set your password, visit the following address:'
) . "\r\n\r\n";
$message .=
network_site_url( "wp-login.php?action=rp&key=
$key&login=" .
rawurlencode( $user->user_login
), 'login'
) . "\r\n\r\n";