call wp_insert_user in custom class doesnt work

In addition to the debugging advice from @s_ha_dum, you could try to catch the possible WP_Error thrown by wp_insert_user(): $user_id = wp_insert_user($params); if ( is_wp_error( $user_id ) ) { echo $user_id->get_error_message(); } else { printf( ‘User created with user_id = %d’, $user_id ); } Maybe the user already exists? You could also use email_exists() and … Read more

How can I apply no-disposable when programmatically adding a user with wp_insert_user()?

What the plugin you mention does is apply a filter to registration_errors, which is used by a function called register_new_user. The quickest and easiest solution would be to use that function instead of wp_insert_user. If that isn’t possible or your code design doesn’t allow it, you can always call no_disposable_email directly, and before wp_insert_user. $errors … Read more

wp_insert_user function not adding password field to database

You don’t need to call ‘pre_user_*’ filters, that are called by WordPress inside wp_insert_user. Also I suggest to use php filter_input or filter_input_array to sanitize form input. Example code: $args = array( ‘pwd1’ => FILTER_SANITIZE_STRING, ‘pwd2’ => FILTER_SANITIZE_STRING, ‘first_name’ => FILTER_SANITIZE_STRING, ‘last_name’ => FILTER_SANITIZE_STRING, ‘username’ => FILTER_SANITIZE_STRING, ’email’ => FILTER_SANITIZE_STRING ); $form_data = filter_input_array( INPUT_POST, … Read more