I figured out the fix on my own, after many try and errors. I just change this line of code:
$status = wp_create_user( $username, $password, $email );
to this:
$status = wp_insert_user( array ('first_name' => $first, 'last_name' => $last, 'user_pass' => $password, 'user_login' => $username, 'user_email' => $email, 'phone' => $user_phone, 'role' => 'subscriber' ) );
It’s working fine!
Related Posts:
- Transaction when using WP functions rather than vanilla SQL?
- How to get the list of WooCommerce product image of a certain category from database?
- How to make WordPress plugin check for database changes and then do something?
- How to Join two tables from separate databases within WordPress
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- register_activation_hook isn’t adding table to DB
- What SQL / WordPress queries would need a nonce?
- Importing Geo data into wordpress database
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- $wpdb->insert() does not Insert record in a table
- Use $wpdb or other PHP script method to find/replace in WP database
- How can I add a new row in a separate database when someone registers via WordPress?
- Pull MySQL data from multiple tables and merge into 1 PHP array
- Use variable in SQL statement
- mySQL queries are executed twice on wordpress website
- making php value numeric
- Database SQL query error
- How to run complex query using PHP
- SQL Query Search page
- can’t delete a row from post_meta table
- Conditional statement within WP SQL query
- Undefined function mysql_connect()
- MySQL column count doesn’t match value count at row 1 [closed]
- SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 102
- dbDelta support for FOREIGN KEY
- $wpdb->get_results(…) returns empty array despite correct query
- How to correctly submit a search form and display the result in an independent page
- Check if post of title already exists
- $wpdb->delete column values IN ARRAY()?
- Custom SQL query to get List of posts with featured image url
- Does WordPress cache get_user_meta() results?
- How to display multiple Post meta_key/meta_values by SQL query
- Delete post revisions on post publish
- Using Echo in ShortCode – Stuck
- Problems migrating WordPress to localhost
- error importing localhost export file to server
- How to sort results from a custom database table
- Update some database fields when post is saved
- sql query to put quotes around numbers in img tag
- List of posts by day of the week
- Different database query in function.php using mysqli
- Strange wordpress slowness
- Setting All Drafts to ‘exclude-from-catalog’ in WooCommerce
- How to securely provide a $_POST var in WP_Query with PHP 7?
- Create WP_Query to search for posts by their categories or their parent/child categories
- Update results, Before deleting the related category [closed]
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- Weird 404 URL Problem – domain name being placed at end of urls
- database sent to a JSON file
- Genesis framework comments broken?
- Databases – Submitting data from inputs to database [closed]
- Help with a $wpdb MySQL Query
- How i can obtain all the post meta for a specific post as an array?
- Is it best to avoid using $wpdb for security issues?
- Can’t Query Custom Table Using $wpdb Method
- $wpdb returns duplicate posts
- Update postmeta after theme switch
- Should I use WordPress to skin a database website?
- Creating Database Table vs. Adding MetaData to Post & User
- WordPress Custom SQL Table with UserID Filter for results
- Correct PHP to output a single result of a Function with SQL Query
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- WordPress WP_Query without query GET parameters
- wordpress site – using custom database and PHP
- Processing ajax call to php to insert into mysql database
- WPDB secure custom form
- Query the links Database
- Fetching review value using wpdb class
- WordPress Custom Query: Combining Two Functions
- MySQL Query Returns Array () In Shortcode
- Display Results of SQL Query on WP site
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- PHP Warning: mysqli_query(): after updating my websites php from 5.6 to 7.2
- Updated Php version from 5.4 to 7.2 and getting “PHP installation missing the MySQL extension needed by WordPress”
- How to optimize and reduce excessive database queries
- How to display MySQL table data which is stored as an array?
- How to import woocommerce custom fields data into another site?
- Collect all events in one year
- PHP 7.2.18 | Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- Advanced WordPress SQL Query
- Splitting table data to pages with numbers
- How can get all users by current user meta (array)?
- Site doesnt work once PHP changed to 7.1
- How to detect if a revision was made by woocommerce or wordpress?
- WordPress WPDB::insert 13th param is always blank (only if format)
- Ajax not updating to database
- MySQL query in WordPress with AJAX
- Processing forms with php to wordpress database
- Sum of Custom Meta written by Authour
- How to connect database table to each registered wordpress user.
- retrieve wordpress post-meta using php not wordpress functions
- Splash pages on a high traffic site
- Using the same shortcode to show any table from the database
- Submit cf7 form to cfdb as pdf/BLOB [closed]
- How to send push notification in android using php? [closed]
- Getting invalid user ID error when creating a new user with wp_insert_user
- Custom form that stores data in mysql database
- Putting form result in my database
- How can I update a value of a field depending on outside source?
- How to return count number from a wordpress database