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
- Encrypt User last name in wordpress for security reasons
- How to: Easily Move a WordPress Install from Development to Production?
- What does this PHP function code mean? [closed]
- Is there a flowchart for WordPress loading sequence?
- How to change the default registration email ? (plugin and/or non-plugin)
- Essential technical features for high-end WordPress web hosting? [closed]
- How to remove admin menu pages inserted by plugins?
- How to put logs in WordPress
- How to get the Date Format and Time Format settings for use in my template?
- Add multiple custom fields to the general settings page
- Where are Additional CSS files stored
- Best Practices for Regression Testing WordPress Websites?
- Remove wrapping div and ul from output of wp_nav_menu
- What Is The Use Of map_meta_cap Filter?
- get post author id outside loop
- Custom Walker: how to get ID in function start_lvl
- Creative uses of WordPress [closed]
- How to *remove* a parent theme page template from a child theme?
- How do I make my child theme re-apply the settings that were customised when its parent was active?
- Multiple Inputs in a Customizer Control
- New WP_Customize API – how does it work under the hood?
- Embedding a SOAP Client into a WordPress Plugin?
- Is there anything that Joomla or Drupal can do that can’t be done in WordPress? [closed]
- Update widget form after drag-and-drop (WP save bug)
- Data sanitization: Best Practices with code examples
- How to benchmark a WordPress installation? [closed]
- Should I delete the default themes?
- Moving WP install from local to live, what about wp_posts GUID?
- Modified wp.media.view.Settings.Gallery in Backbone JS, but editing doesn’t work
- Running Gutenberg React in Development Mode
- Prevent WordPress from automatically installing a new theme each year
- Can we use one WordPress installation for multiple databases, domains and content directories
- Is there a blank theme framework compatible with WP 3.0? [closed]
- Plugin SVN & update API – how are plugins identified?
- Users with custom roles not showing in post author select box
- How to use more than 256MB of memory in the admin?
- Whats the best way to share user data across multiple WordPress websites?
- How do register_sidebar() and get_sidebar() work together?
- How do you get formatted content of a post using the WordPress API?
- Localization: I want the backend: english and frontend in defined language
- Are there any forks of WordPress (and what is different about them)?
- How to Change 404 page title
- Make Custom Metaboxes Collapse by Default
- WordPress Paginate $wpdb->get_results
- Custom maintenance page
- Add button to TinyMCE bar without creating a plugin
- Why do I get the timeout warning?
- How to add a new product type on woocommerce product types? [closed]
- How to include own css on wordpress tinymce editor?
- How to disable page delete
- add button to post edit page when post_status=publish
- how to override woocommerce specific loop or archive-product.php [closed]
- Modify existing plugin function using filter (without modifying the plugin directly)
- Rename UPLOADS folder with custom WP_CONTENT_DIR
- WordPress hook before inserting post into database