You should be using add_user_meta instead of update_user_meta:
if (isset($_POST['billing_cpf'])) {
add_user_meta($customer_id, 'billing_cpf', $POST['billing_cpf'], true);
}
As this will only add the meta if it does not already exist – no update.
(This will prevent this field from being updatable – unless by you another way.)
Note: normally you could use something like this to add and update in combo so that the field is updatable:
if (isset($_POST['billing_cpf'])) {
if (!add_user_meta($customer_id, 'billing_cpf', $POST['billing_cpf'], true)) {
update_user_meta($customer_id, 'billing_cpf', $POST['billing_cpf']);
}
}
Related Posts:
- Creating search form for custom database table
- generate unique number when registering a user
- Adding extra info via GET while registeration in wordpress
- Many users with strange names register, but don’t leave comments. Should I be afraid?
- Get multiple db prefix with $wpdb
- How can I add data to a custom column in the Users section of the wordpress backend?
- Adding a Table to the wordpress database
- How to pass external variables to the wp_new_user_notification_email filter?
- Add custom user profile field to default WordPress MultiSite registration form
- What’s wrong with Customizing new user notification email by add_filter?
- Function to allow “Anyone can register”?
- Get Value from Column in Plugin Table [closed]
- I want to submit multiple users if checkbox is checked
- The function can not create a table on MariaDB server
- How Can I Move Data From Form 1 To Form 2
- Auto login from custom registration form
- Creating custom database table with crud operation
- Diffrent User registration form for doctor and patient
- Add Field to WordPress Register Form
- dbDelta not creating tables with composite keys
- Saving contact form 7 data into custom Table
- How to make wordpress use a non-wordpress users table?
- Gravity Forms – gform_field_value – query custom table breaks functions.php
- Custom login and registration forms
- Custom select query two tables by a meta key
- Create Unique ID for user
- Custom Database Table and foreach
- Custom Register Link on Backend Form
- Hook before user is created and make some custom validation
- How to change the login page without a plugin and not only customizing logo and text around the form?
- WordPress search on a custom table
- Get All Results From Other Users That Share The Same Custom User Meta As Current User
- What is my error trying to create a new table in the database?
- data retrieval presents last set of data
- Create single{custom}.php with data in table out of wp_posts
- How to display all post from the same current usermeta
- Custom user fields validation on registration
- Database custom table issues – incorrect result displayed
- Changing starting number of User ID
- Custom options – register, defaults and delete empty fields (Settings API)
- add unique code required to register
- User registration add user ID?
- Custom table or form
- When is it OK to create a custom table for a plugin? [duplicate]
- Redirect all pages to the custom login page except for the registration page
- Looking for a lightweight theme using WP3 new tags and features (not 2010) [closed]
- How can I get posts in a subcategory to display on it’s parent categories archive page?
- Creating my own Admin Forms in a WordPress CMS?
- Custom taxonomy: same terms, but for different years
- Best practices for A/B testing?
- Editing the Number at the end of Page URLs / Editing Page Slugs
- simple wp_insert_post example
- Redirect members to custom page upon logging in through WP admin
- Can I use $wpdb for my custom tables in the WordPress database?
- How to get input_attrs in the sanitize function?
- Integrating MailChimp newsletters as post
- What is WordPress file encoding?
- WP_Query with the “offset” argument
- Adding “Interesting Tags” & “Ignored Tags” like StackOverflow.com in a WordPress Blog?
- Auto add taxonomy if post has category
- Add a containing DIV to core Gutenberg blocks
- Allow comments without approval for custom content type
- Are there any security issues with setting the WP_INSTALLING constant to true?
- Naming script handles right way
- WordPress generated links – menus and home_url() – not using https despite settings
- How to use
- Name/Word Replacement Plugin
- Get page ID outside the loop, matching menu ID
- How to check if a custom user profile field is empty
- Author Tracking Code!
- Show Featured Post Only On The Homepage
- How can I create a second multisite network in a subdirectory?
- order event posts by multiple custom fields
- Customize option – add two image uploader under same section
- Moving wp-content folder
- Modify the display Text of number of comments
- Toggle custom fields?
- How to add span on WordPress Title for first and third word
- Edit specific text on a static page
- Showing Meta Box via Jquery Checkbox
- Problem with custom function from jQuery slider tutorial
- Adding re-type email and check it if the email match
- Problems with setting up a subdomain to serve images and scripts
- Change login cookie expiration time?
- Disable “-mp4-image” screenshots from appearing in Media?
- wordpress custom posts page not showing
- Post filter with multiple checkbox taxonomy terms
- Replace publish date in blog module with custom field
- Creating WordPress staging environment software
- Is there a way to limit multi upload in media upload box?
- Use another theme template in my theme
- Plugin does not create a custom table upon activation
- Pulling posts into static site (wordpress as subdirectory)
- Call a duplicate registration form with other url
- WP Customizer – what types of fields is it capable of supporting?
- How to make my wordpress site responds for 2 domains
- How to answer, and we aren’t using WordPress to manage your site? [closed]
- responsive screen not working [closed]
- Is there a way to have information on one page automatically feed into another? [closed]
- Why after customizing Home Page, the site is loading six missing blob sources, slowing down all site?