Hello,
Thanks for the great plugin!
I also need the same thing.
A functionality to auto create the login link on account creation but only for certain user roles.
For a project I’m building. I already created a custom add new user back-end page based on wp_insert_user() method to add users of a specific user role only.
Would it be possible to trigger the login link generation in this part of user creation?
wp_create_nonce(pkg_new_user_update_nonce_name($user_id));
$userdata = array(
'user_login' => $user_name,
'display_name' => $user_display_name,
'user_name' => $user_name,
'first_name' => $user_name,
'user_email' => $user_name.'@test.com',
'user_pass' => wp_generate_password( 8, false ),
'user_role' => 'subscriber'
);
$user_id = wp_insert_user( $userdata ) ;