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?
- Can I count the number of users matching a value in a multiple value key?
- 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
- 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 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?
- 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
- 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?
- Delete all custom fields at once?
- Buddypress Add unserialized Profile Fields in Members Loop [closed]
- How do I create a column in Users list and display user data from custom registration field
- Better Method for Multiple Meta Boxes
- Displaying a checkbox array from advanced custom field
- WP 3.1 meta_query for multiple custom field values
- 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
- How to remove custom fields from the selector?
- Show image if author meta (profile fields) exists outside loop
- Check & remove special characters in a field?
- 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
- 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
- Showing Custom Fields on Parent Page
- How can I output the custom fields wrapping with HTML
- 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
- 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
- Counting post fields
- Display Additional Info
- Populate custom checkout fields with data from previous orders
- User query – getting values for custom meta keys/fields
- How to get data from user meta custom fields created with acf-pro plugin?
- How to save multiple values with same meta_key, each value linked to another tag id
- author.php not showing content if Author has no Posts
- Getting user’s data, by custom field lookup (meta)
- select user with all meta field and field value. I am use Below Query for this ,So any of know another way to fast query instead of below query?
- Redirecting to an external URL
- update_user_meta(): invisible data storage
- Extend WP_User_Query or WP_User to return all custom fields?
- Delete custom fields on post publish?
- When post is updated, custom metadata in text area field is overwritten
- Create custom fields/meta data gender+country – radiobuttons and dropdown on register screen for these fields
- Adding custom fields to images
- wordpress simple post multi rating with post_meta and user_meta
- Custom fields are not displaying in page with multiple loops
- Using Hooks. Thematic
- Adding thumbnails for non-image attachments
- Custom field in a shortcode?
- How do i get a specific user metadata using custom metavalue outside of wordpress?
- I would like to display different text on different pages
- Semi-Private Comments + page comments -> is it possible?
- Custom registration form and custom field
- Check if a field is capitalized?
- Can’t sort custom column on user.php by number / meta_value_num?
- How I can change PayPal IPN ‘custom’ field in woocommerce?
- Problem display
- Google not index my Custom 404 page ?why?