wp_send_new_user_notifications
Initiates email notifications related to the creation of new users.
Description
Notifications are sent both to the site admin and to the newly created user.
Parameters (2)
- 0. $user_id (int)
- ID of the newly created user.
- 1. $notify — Optional. (string) =>
'both'
- Type of notification that should happen. Accepts admin or an empty string (admin only), user,, or both (admin and user). Default both .
Usage
if ( !function_exists( 'wp_send_new_user_notifications' ) ) { require_once ABSPATH . WPINC . '/user.php'; } // ID of the newly created user. $user_id = -1; $notify = 'both'; // NOTICE! Understand what this does before running. $result = wp_send_new_user_notifications($user_id, $notify);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/user.php
- function wp_send_new_user_notifications( $user_id, $notify = 'both' ) {
- wp_new_user_notification( $user_id, null, $notify );
- }