wp_send_new_user_notifications

函数


wp_send_new_user_notifications ( $user_id, $notify = 'both' )
参数
  • (int)
    $user_id
    ID of the newly created user.
    Required:
  • (string)
    $notify
    Optional. Type of notification that should happen. Accepts ‘admin’ or an empty string (admin only), ‘user’, or ‘both’ (admin and user). Default ‘both’.
    Required:
    Default: ‘both’
定义位置
  • wp-includes/user.php
    , line 3438
引入
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.

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