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
- How to properly prepare a column name if passed to a stored procedure?
- inserting a post from an extern php file but post content doesn’t show on wp site
- Database query works fine outside WordPress
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- $wpdb->wp_users returning empty value for
- Genesis framework comments broken?
- Large Woocommerce Site (83,000 items), What Can I Do? [closed]
- Using custom tables for old posts
- Databases – Submitting data from inputs to database [closed]
- Help with a $wpdb MySQL Query
- WordPress SQL injection
- Not connecting to database in file with multiple MySQL connections
- Way to bulk make all my tags lowercase?
- $Wpdb post meta query is not working with mutliple meta keys and values? [closed]
- How i can obtain all the post meta for a specific post as an array?
- multiple where condition in result query
- Grouping posts by a custom meta value
- Multiple meta_key in one global $wpdb;
- Custom array from a query only write the last row of the query
- WordPress member notification
- Is it best to avoid using $wpdb for security issues?
- Can’t Query Custom Table Using $wpdb Method
- Moving wordpress site from localhost to live server using GoDaddy cPanel
- How does WP work in conjunction with a web server?
- WordPress Block developer from exporting Database via PHP
- $wpdb returns duplicate posts
- Update postmeta after theme switch
- Mixing variables into an array when inserting values
- Location of core code for database connection and get_header
- wpdb prepare insert table doesn’t work
- Should I use WordPress to skin a database website?
- php include not working in custom page
- How do I display offsite database info on my wordpress site?
- Creating Database Table vs. Adding MetaData to Post & User
- Make a database query using WordPress
- Force Users To Relogin
- WordPress and MySQL: trying to print data using PHP from user_meta custom field data
- dynamic page using php from sql database
- WordPress Custom SQL Table with UserID Filter for results
- Most commented posts by time period (last 12h, last 24h and etc)
- email alert for product availability
- How to Update post_modified of all wordpress post
- Correct PHP to output a single result of a Function with SQL Query
- Issue with fetching mysql data and displaying results via shortcode in webpage
- Basic wpdb update question
- Hide posts if user is added to it WP_query
- I can’t update my data through $wpdb
- A $_POST should occur when submit form but is not?
- Custom route and query
- Output: “Array”
- How to unserialize data from MySQL
- How to use mysql LIKE with wpdb?
- PHP -> SQL Query with Summing
- Lost in trying to create user database system
- 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
- How do I prepare strings for insertions as values into a MySQL table?
- Filter results from a serialized string to use on statistics
- Known Issues in WordPress When Upgrading PHP to ver 7
- Using CFDB7 vs Custom MySQL Database [closed]
- wordpress site – using custom database and PHP
- How to use AJAX in WordPress in MYSQL query?
- add category to posts with tag wordpress
- Searching Posts Programmatically in a WordPress Plugin
- How can I Use 2 databases with one WordPress install
- Using wordpress function to retrieve data
- Live search from database table
- Processing ajax call to php to insert into mysql database
- Edit Account – read and write to MySQL
- form $_post action value gets truncated after it passes through two forms
- Why my query does not run with prepare
- Get the id of the row from database on click of a button [closed]
- Why won’t this wpdb get_results query return results?
- WPDB secure custom form
- Why when I create a new post I found 2 record related to this post into the posts database table?
- Adding data to custom wordpress database table
- wpdb getting avatars and author url
- phpMyAdmin error #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- Add row to custom database Table and delete all rows older than 1 day