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 username_exists() to check.
Related Posts:
- Adding fields to the “Add New User” screen in the dashboard
- How to add custom fields to my custom registration form
- Change label for registration Fields
- Add multiple custom fields to the general settings page
- How to check if a user exists by a given id
- Use author author display name in permalink structure for pages and posts
- Get a list of all available fields in the User Profile
- Logout redirect to current page – function
- How to paginate the get_users function?
- How to add first name & last name to default registration form?
- How to display random users with avatars
- How to manually activate user in dashboard only by admin
- Add new user : make the fields First Name and Last name required
- wp_delete_user with username
- Create new user without password
- How to display error messages using WP_Error class?
- Change labels on ‘Nickname’ and ‘Biographical Info’ in user-edit.php
- How to override WordPress registration and insert an auto-generated username?
- Order get_users() by last login date. Is it possible?
- How can I tell when a user is logged in?
- Restrict user registration to emails on a single domain
- how to get and display logged in user’s recently read posts
- Displaying a random user with a shortcode
- How to update BuddyPress xprofile fields programmatically? [closed]
- How to detect first visit of a user?
- Can I pass two roles to the function get_users?
- How can I add an image field to BuddyPress Extended Profile Fields? [closed]
- Remove default user registration, login and subscriber profiles
- Create dropdown of users in admin dashboard
- WordPress registration and contact form 7 [closed]
- password protected post policy
- Custom registration URL lost when user makes signup mistake
- Remove the deleted users avatar from list
- Get Current User info using wp_localize_script, in functions.php
- create shortcode to list users with specific meta key value
- Don’t delete a page if it holds users
- Display alert on successful user Sign Up
- How to make custom column Admin>Users sortable?
- Execute a ultimate member action when user role is updated
- Filter out other users comments. Visualize only own comments and editor role users’ comments
- Force to use STRONG users password and implement rule to prevent REUSE [closed]
- Multisite 404 on pages – rewrite error breaks database
- Registration Hooks don’t appear to be working
- Trying to register script in footer
- Condition OR for current user ID
- Is there a way to direct unregistered user to registration page when click a link?
- How to Use Global Variables Inside Header and Footer
- Secondary Menu and Logged In Users
- Why get_user_by() doesn’t work in my code?
- Adding additional roles on registration
- Filter to wp_list_authors
- How to add array [closed]
- Add Link to Users List (Backend) to open each users front-end profile
- Suggest Users basing on User taxonomy
- Showing user profile data on front-end
- Modify function to only return values for the user that’s logged in
- loginout function customization
- User meta and public function security
- Get users with different roles and call function on each of them (user_meta)
- How to setup a popup registeration page in wordpress with function.php
- Show errormessages on wrong username/password on custom loginform?
- How can I show different content for different user-levels?
- Custom user role still showing up after deletion, ideas?
- referencing the current user in a page i created in wordpress
- Show metadata in users.php – wordpress
- Allow user select role in wordpress default registration without plugin
- Deleting guests profile users after 1.5 hours
- wp_get_current_user return ID = 0 when used outside of wordpress, such as webhook / fulfillment dialogflow
- Unable to login after registration
- Allow user only create specific tags
- Add Change role button for list of user in an event
- get_current_user_id() always return 0 in if else statement
- Show users last read posts for each user?
- Set display name from nickname with register process
- Restrict certain roles registrations by domain
- How to add number to wordpress count function?
- Changing the register url is not working
- Problem in outputting shortcode
- Problem in shortcode outputting content
- Mail function not working with user accounts
- Register a widget area when a theme option has been saved?
- get USER ID in functions.php using user_register action
- Help finishing script to export WP user data when form submitted
- Whats the proper way to add a new user via a front end form?
- sort by date in users
- Add custom css to specific user
- Edit text of WordPress “Register” button
- Display ACF category image on archive and single template files
- Get URLs for AJAX Filter Checkboxes WordPress
- How to get taxonomy tree ids without running expensive loops
- define two login page url
- Message notification for user
- Get slug of current category in functions.php
- wordpress built-in Jalali date convertor
- Disable autosave with `function.php` for custom post wordpress?
- sort metabox columns in listing Single
- WordPress login set cookie that survive browser exit (wp_signon function)
- wp_nav_menu displaying all pages
- WordPress 6.0 upgrade caused my custom function to stop working
- User with same Mail but a different additional info(like domain)