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
- New WP_Customize API – how does it work under the hood?
- Data sanitization: Best Practices with code examples
- how to override woocommerce specific loop or archive-product.php [closed]
- global menus made from master site’s custom menus wpmu network
- Make page template that is just an “include” of another?
- Is there a way to create invisible pages?
- Count widgets of a certain type
- Custom widget select options needs to stay selected after save
- Syncing Avatars across multisite
- How to move the wordpress site from test url to main url? [duplicate]
- How can I get the intended URL in a 404?
- Creating user relationships
- Multiple sites/domains with content all managed by single installation of WordPress
- How to change email address used for registrations?
- Loop through custom fields with similar label / common chars in label
- title, content, feature images
- How Do I Remove The Right Hand Block On The Main Header?
- Category selectable homepage
- Add custom profile field only for site admins?
- Development environment
- Adding comments to my custom theme
- Woocommerce product permalink not working
- create Custom field for tv series
- Data won’t save if metabox within conditional in admin. What am I missing?
- Restrict Viewing of post on both front and backend?
- I w’d like to know If there are simple solutions to integrate other CMSs to wordpress
- add_feed rewrite overwriting standard permalinks
- Editing a post template
- Customizer – How to get theme mod range value?
- Let author add field to metabox by pressing a button
- Date Ordered Archive Page for single category?
- GUID URL Question
- Customize Widget Navigation
- display text generated via custom get query string
- Add admin page for specific post status (for example)
- How can I style the Comment Section of a blog post
- Custom Meta Box: Value saved in WordPress DB, but not shown in input field on Edit Screen
- Custom post-type working except for Selecting page-parent
- Upload image without resizing but insert in post with resizing
- Expressions and str_replace
- How to create a new blog in wordpress?
- Best way to move a site to a subfolder for testing purposes?
- Wonderflux Framework Static Homepage
- How to customize theme?
- Creating Action Hooks For Automatic File Inclusion
- Customizing the built-in Media Playlist
- Best way to create a page outside of the pages list
- To merge customized codes upon wordpress update
- Need Advice to Working with Custom Post Meta
- Custom Slider Per Page created
- why jquery is not loading in wordpress page?
- use another theme for just one page
- I need to make the title of the page dynamic in my custom plugin
- Custom CSS working on home page but not on NEW created PAGE
- Custom Menu (only showing direct cildren) ACF not showing