wp_send_new_user_notifications()WP 4.4.0

Initiates email notifications related to the creation of new users.

Notifications are sent both to the site admin and to the newly created user.

Хуков нет.


null. Ничего.


wp_send_new_user_notifications( $user_id, $notify );
$user_id(int) (обязательный)
ID of the newly created user.
Type of notification that should happen. Accepts 'admin' or an empty string (admin only), 'user', or 'both' (admin and user).
По умолчанию: 'both'

Список изменений

С версии 4.4.0 Введена.
С версии 4.6.0 Converted the $notify parameter to accept 'user' for sending notifications only to the user created.

Код wp_send_new_user_notifications() WP 6.2.2

function wp_send_new_user_notifications( $user_id, $notify = 'both' ) {
	wp_new_user_notification( $user_id, null, $notify );