Ok, I found the solution.
I placed the ‘wp_insert_user’ in a variable.
And I used that variable to define the extra fields with ‘update_user_meta’.
// If successful, register user
$user_id = wp_insert_user($fields);
update_user_meta( $user_id, 'teste', $fields['teste'] );
Related Posts:
- How can I save unique user data on my site? [closed]
- How build a custom login/register form with error handling?
- Integrating WordPress to my website, while keeping my own authentication system
- How to disable wordpress confirmation email for new users
- Calling a method from functions.php on a click of a button
- Showing user ID on user main page from screen options
- wordpress separate registration for different roles
- Authenticating to WordPress, using my own authentication two-factor system
- Best way to create a user programatically
- Why when I instantiate wp_error in a validation method my user registration method stops working?
- Remove username in emails or swap username for email
- Issue with foreach on duplicate meta_key’s
- get_usermeta() deprecated in favor of get_user_meta(). But why doesn’t it make use of it?
- Passing the page ID to a login php script
- How to send user data in json format to another server when user register on wordpress site in PHP
- items_wrap not working
- WordPress shows registration link for non logged users
- How to display user nickname (not display name) in PHP template?
- Get all user meta by meta key instead of ID
- Create a new usermeta field for users
- What’s the best user registration library to integrate WordPress?
- How to get a list of all possible values of a specific user meta key?
- How do I display a user’s previous orders as a select box option on a product?
- Anyway to output the registration form like the login form with wp_login_form()?
- Redirect to a different page through registration, depending on page
- How to use an associative array in post__in with WP_Query?
- User management system similar to wordpress one?
- How to check if a meta value has already been assigned to any user?
- adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again
- function to assign user role based on a field from usermeta
- Creating user status mode in WordPress
- user_profile_update_errors hook not executing
- Adding number to date not working [closed]
- How to abort saving data in save_extra_profile_fields function WordPress?
- Paypal form integration with wordpress registration form without plugin [closed]
- Let Users Choose Post Categories
- Update user profile information from functions.php
- a:0:{} is replaced into database as s:6:”a:0:{}”;
- User register hook is not working in woocomerce register form
- Password minimum length in personal subscription [closed]
- Run a code only on theme activation only during first activation
- Fatal error: Call to undefined function register_new_user()
- Countdown to date function?
- How Can I Edit the Registration Code?
- Getting users with a specific meta data and then querying their posts?
- How to update and save user metadata on page visits?
- If Array Values Match Another Array’s Values, Then
- User Meta Value not echoing despite Var_Dump Showing correct string
- Shortcode for Listing Users from Meta Value?
- Getting different user data depending on where I use variable
- Custom Registration username_exists / email_exists
- Comapare get_user_meta value
- How can get all users by current user meta?
- Custom User Registration script only allowing usernames with 16 characters
- Edit Account – read and write to MySQL
- Update user repeater meta (ACF) with another user meta field value
- Create condition for Author bio Social Links
- How to store checkbox data for individual users?
- How do I Populate a Table Field with User Meta Data?
- How to add and subtract user meta values after post meta update
- User meta needed in query is serialized – how to unserialize safely?
- Include User ID in iFrame URL
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- Usermeta data unserialize, extract and display in table in WordPress
- Change user metadata on registration (show_admin_bar_front = false)
- Store data from JavaScript object to custom table in user account
- Export WordPress User Meta to CSV/Excel
- Updating User Profile information removes image
- Issues adding Recaptcha v3 to WordPress Registration
- How to change the value of a variable using input field?
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- Help hooking into user_register
- Where do I implement this display of User Meta Data, and how to put it in a table?
- How to auto-generate random numbers in username?
- Update an additional user meta field with a string
- Store custom field’s multiple values in one user meta key
- Get field in readable word
- Attaching an upload to a user
- not able to access $_POST on backend profile update
- Right way to display the_author_meta fields?
- Adding user meta to post meta wp_insert_post() not working
- Get meta_query value by user meta array
- How can get all users by current user meta (array)?
- Newbie question. Login/Registration. New PHP page
- Store stripe info as user_meta
- Private messaging – Getting and displaying the avatar/url of a message recipient
- Updating custom user meta
- Updating meta_value in a custom key
- Registration form not registering First and Last name
- Limit the number of successful logins
- Editing a WordPress plugin to add my own functionality
- Get author meta of all writers
- Let users register weight each day and save it in DB
- how to register a second page-template
- Hide a nav menu item based on get_user_meta results
- A better way to write this php function
- Import users and custom user meta from csv
- WCFM Custom form
- rest_cannot_create_user – Sorry, you are not allowed to create new users. CURL WORDPRESS REST API
- How do I do so that people can register on my wordpress site?