I have created a custom plugin that will provide some custom user roles that are named
operators. When an user will create a new account, I've created some logics that imply that operators need to approve the new accounts. Using the
wp_insert_user() I'm able to save new users into the database and thay will not get the login password to this step, after operators approval they will get a password generated using the
wp_generate_password() function. At the moment, what I want to achive si to disable password change notification so the users will only get the emails I want to send them, so, a first email that will inform about the account status and the second that will give them the credentials after 24 hours from approval.
I've readed the documentation about
send_password_change_email and it will be a lot clear about the filter. At the moment I have this code
$password = wp_generate_password( 12, true, true ); // $assigned_card_number = get_user_meta( (int)$customer_details['ID'], 'num_tessera', true ); // $user = wp_update_user( array( 'ID' => (int)$customer_details['ID'], 'user_pass' => $password, 'meta_input' => array( 'account_details_sent' => true ) ) );
Can I call the filter after I've used the
wp_update_user function and inside the same method?