// Set the new user information
$new_user_data = array(
'user_login' => 'kanhu123',
'user_email' => 'kanhu@gmail.com',
'user_pass' => 'kanhu@123',
'first_name' => 'New',
'last_name' => 'User',
'role' => 'subscriber',
);
// Insert the new user
$user_id = wp_insert_user($new_user_data);
// Send a notification email to the user
//both admin user
wp_send_new_user_notifications($user_id, 'both');
wp_send_new_user_notifications($user_id, '');
wp_send_new_user_notifications($user_id);
// only user
wp_send_new_user_notifications($user_id, 'user');
0 Comments
Post a Comment