Use the project name in the meta key field & the amount donated as the meta value, and I would suggest using update_user_meta
rather than add_user_meta
because reasons. Something like this:
$project="donated_to_" . $project;
update_user_meta( $user_id, $project, $amount );
Apply some sort of logic before setting those variables – you know, in case the user has previously donated to that project.
The function update_user_meta
is available on the front end and as for security, use a nonce on the form where you’re collecting this data and check the nonce & user permissions on processing of the form and verify/sanitize the data received from that form during variable assignment.
Related Posts:
- query usermeta from custom field
- custom avatar removal
- Save custom field types with this function…?
- How to filter post listing (in WP dashboard posts listing) using a custom field (search functionality)?
- Add validation and error handling when saving custom fields?
- Validating Custom Meta Box Values & Required Fields
- Is there a way to set default custom fields when creating a post?
- Add custom objects/entities to WordPress
- Can I count the number of users matching a value in a multiple value key?
- Save custom user meta on registration
- How to get users by a custom field / by user meta data?
- Adding another state (spam, reject, approve) to wordpress comments?
- How do you add a custom option to user data?
- Edit Custom Database Tables in WordPress
- Filter results with custom field values and dropdown
- Meta keywords and descriptions plugin for manually editing meta for each page/post
- Making a configurable field translatable
- Is there a way to do multiple ordering on a multiple meta_query?
- Check before publishing, if already exist post with current custom field value
- Show User Their Password
- How to customize default wordpress editor?
- generate unique number when registering a user
- How to update serialized data in the user meta data
- Custom Fields Bulk Edit
- Custom Page Template [closed]
- How to make custom comment fields required and message field not required
- Problem in custom meta boxes
- How to show custom field’s value under post/page title in wp-admin
- Multiplile values checkbox or select in custom meta box
- Adding Properties to User Profile and Displaying in List
- ajax delete value from custom field array
- How can I sort get_users() by any value (last_name, user defined fields and more)
- How do I read the value of a custom field of the page?
- how to save multiple custom fields for a post in one go?
- Displaying additional User Contact Information
- get_post_meta in sitewide tags plugin fails to return value for custom fields
- get_user_meta Short Profile Section
- Best way to add custom / magic / flutter fields into RSS feed
- Separate table or usermeta
- Insert attachment ID in custom field from media uploader
- meta_query for a string inside a meta field containing a comma-separated list
- How to update custom user meta field in wp?
- How do you create dynamic customised sections in WordPress?
- Delete all custom fields at once?
- Buddypress Add unserialized Profile Fields in Members Loop [closed]
- WordPress User Profile Upload – If page is saved file reset
- ACF: How to get the full field name (meta_key) by a field key?
- How do I create a column in Users list and display user data from custom registration field
- How to save multiple options from a dropdown in user profile
- WP_User_Query pulling ACF to loop
- Users Select inside custom metabox
- Better Method for Multiple Meta Boxes
- Displaying a checkbox array from advanced custom field
- WP 3.1 meta_query for multiple custom field values
- How to make condition, based on custom fields value?
- How to select posts from multiple categories and metavalues?
- Sort custom field by post
- Send email with custom fields after new draft is saved or new post published
- How to add upload video option in wordpress for user?
- Passing args to WP_User_Query am I using meta correctly?
- How do i add custom fields to my themes template file?
- How to save the date/time of last update of an extra user profile field?
- Custom tables or custom fields?
- Post selector as Custom Field
- I need a “Choose from existing content” popin
- For homepage images (for small business website), is it better to use custom fields or post_thumbnail?
- How to remove custom fields from the selector?
- Show image if author meta (profile fields) exists outside loop
- How can I hide custom field from users used for caching response from external api?
- How to query an out put value?
- Check & remove special characters in a field?
- Let’s Create Custom Field Template Documentation
- How can I combine this php statement to get the results of multiple variable inputs?
- ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
- How to add fields in custom registration form, validate it and aave to db? [closed]
- check for duplicate user meta data before updating
- frontend submit post jQuery clone row won’t save
- Custom Field Repeating When Using foreach
- Is there a way to set default custom fields when creating a new post?
- Increment user meta data by 1 each time a page is visited
- Front-End User Profile
- Get emails from users by custom field SQL
- award points to a user each time they update their cpt post
- MetaBox not saving after empty
- How to update user profile custom fields
- Get text from user and display it on page
- Custom Fields Question
- Showing Custom Fields on Parent Page
- How can I output the custom fields wrapping with HTML
- Custom meta boxes not saving
- How to get all custom fields with some prefix in key?
- Best way to achieve multiple links in a post title
- WP-eComerce Advance Meta Tag data in descending order [closed]
- Meta Box Plugin Cloned Fields – Multiple Foreach values
- Searching with Multiple (Parallel) Criteria on Custom Fields?
- Make separate text boxes for separate WordPress Custom Fields
- Custom field bug in WordPress 3.2
- How to sort post listing on a page using custom field value?
- Adding re-type email and check it if the email match
- Odd functions.php issue in WordPress