Instead of wp_create_user
, use wp_insert_user
. So you will be able to set extra variables like nickname
, display_name
separately than the default value.
For your case, you can code like this:
$args = array (
'user_login' => $user_name,
'user_pass' => $random_password, //send as plain text password string
'user_email' => $user_email,
'nickname' => $user_nickName,
'display_name' => $user_nickName
);
wp_insert_user( $args); //on success, it will return user id
Here is the codex refernece for wp_insert_user
Related Posts:
- Get rid of Another update is currently in progress
- Admin user can’t update WP
- Why are there updates for obsolete WordPress versions?
- No CSS being loaded on backend
- Enable update notification, disable updates
- After updating WP keeps nagging about a newer version. Why?
- WordPress 3.9 Database Update Infinite Loop
- Real automated and unattended wordpress upgrade including plugins
- Prevent/Disable Automatic Update Check
- Why can’t I update username through WordPress API?
- Does set_transient() overwrite/update transient option with same key?
- Permissions to wp-content folder in Windows Server 2012
- Why is Google Webmaster Tools telling me to update WordPress
- Update, add, remove plugins, themes or wordpress behind load balancer
- Update WordPress automatically on its own
- How to force function to run as the last one when saving the post?
- git and local wordpress: how to handle wordpress updates?
- Find out if there is a available core update?
- Using wp-cli to Update WP Networks / Multisite from 3.5.1 to 3.8
- Check if any users are logged in before running update
- “You have the latest version of WordPress. Future security updates will be applied automatically.”
- How do I update a custom theme
- WordPress with composer, how to handle updates?
- wp core update not working anymore
- Update Failed: There has been a critical error on your website
- How can I prevent a plugin from searching for updates?
- WordPress load-scripts.php encoding issue
- Can’t update WordPress, need to reboot the VPS
- Plugin for automated upgrade of WordPress core and it’s plugins?
- Deploying Updated or New Plugins That Modify the wp_options Table
- Website not updating – no cache plugins active!
- Why are the automatic updates to WordPress behind the version my site is on?
- What are the properties of $item passed in the auto_update_{$type} filter?
- Why does One Click Update fail on localhost using FTP with 777 permissions on site files?
- Auto backup before automatic WordPress updates
- Still Another update is currently in progress by updating WordPress 5.3
- Is there any workaround to a core update still showing after core update if language set to anything other than US English
- Why does WordPress 4.2.2 require FTP to update?
- Why won’t WordPress on localhost find updates?
- How to do an event when any user updates their profile?
- Should I upgrade?
- Apply a tag to every images ‘Link Rel’
- Updating beyond WordPress 4.2.1 yields “allowed memory size exhausted”
- “The package could not be installed” when updating plugins, themes, and core files on WampServer
- Where can I find the corrent version of my wordpress blog?
- 4.9.5 broke site behind load balancer, forwards to localhost [closed]
- Error updating WP-CLI
- Jetpack Upgrade fails with WP CLI [closed]
- What file(s) in core control automatic background updates?
- How can I quickly get a system showing the “Uncaught Error: Class ‘WP_Site_Health’ not found in” up and running again?
- Can’t upgrade WP 5.6 to 5.6.1: version-current.php is missing
- Replace or Alter the wp_version_check() Function
- Cannot update WordPress to 5.2
- Update WordPress – Another update is currently in progress
- Errors when updating plugin through the WordPress plugin repository
- WordPress updates being blocked by proxy
- Translation update successful but apparently not
- WordPress update messed special characters
- 3.1 update erases customized function page?
- How much maintenance is required to run a WordPress server?
- Where can I see all changes for a new WordPress version?
- Update to WordPress 4.7 – Fatal error: Maximum execution time of 30 seconds exceeded
- is wpdb->replace() already sanitized?
- Where does wordpress gets its core and plugin updates
- How to back up and up date a site to a newer version?
- I tried updating my Live wordpress site to the latest wordpress version (v4.7) and i encountered some issues
- Site Cookie Error, Redirection and Blank Pages after Upgrade
- opcache_reset on plugin/theme/core update
- Can’t update WordPress 4.0
- Theme my login and update user meta
- why does installer/update screens not progress on some webhosts?
- Can I Update WordPress 2.9.2. to 3.0.4 from admin
- WordPress managing dates that change in text regularly
- Updating wordpress from my Linux distro’s repository
- Can not save changes after an edit
- Admin keeps showing pending translation update
- mystery checkbox in comments area
- How to get the date of last updated post or page and put it in the footer
- Updates page not showing formating
- Automating svn updates from a server-side cron job
- Issue after WordPress update
- Correct procedure for fixing broken WP sites after WP version update
- Update WordPress from non-public machine
- WordPress Auto Updates
- WordPress NOT notifying of new update in dashboard
- Core update of 4.2.3 changes all link to https [duplicate]
- Error on update translation
- Not able to Update wordpress to 4.0
- Custom message when wordpress updates are available
- How can I upgrade wordpress with manual?
- disk was full but wordpress still having issues
- If I place custom files in WordPress root, will they be deleted?
- WordPress 4.8.2 redirects back after install and asks to delete/change config
- Problem updating from 3.6 to 3.7
- Is updating from a zip file the same as a regular update? [closed]
- Hook or function to check if performing a WP Core update?
- How to update WordPress plugins properly using git?
- add_editor_style not working after upgrade to WP v 6.2
- edit wordpress website automatically from a program
- WordPress is updating only patch version and not minor