Sounds like the $amount
variable is empty so it’s not saving. Echo it out to see what’s happening.
Make sure the $payment_user_id
is an actual WordPress user_id
.
Wrap your update_user_meta
within the if statement.
// If charge is successful, store in user meta
if (isset($event) && $event->type == "charge.succeeded") {
$amount = $event->data->object->amount / 100;
echo $amount . ' <- $amount';
$payment_user_id = 9192321;
update_user_meta($payment_user_id, 'payment_history', $amount);
}
Related Posts:
- Calling a method from functions.php on a click of a button
- Showing user ID on user main page from screen options
- Issue with foreach on duplicate meta_key’s
- get_usermeta() deprecated in favor of get_user_meta(). But why doesn’t it make use of it?
- How to display user nickname (not display name) in PHP template?
- Get all user meta by meta key instead of ID
- Create a new usermeta field for users
- How to get a list of all possible values of a specific user meta key?
- How do I display a user’s previous orders as a select box option on a product?
- How to use an associative array in post__in with WP_Query?
- How to check if a meta value has already been assigned to any user?
- adding custom user input fields in WordPress admin dashboard gives error The link you followed has expired. Please try again
- function to assign user role based on a field from usermeta
- How to upload a file to a folder named after the user_id via plugin
- Creating user status mode in WordPress
- How can I save unique user data on my site? [closed]
- Adding number to date not working [closed]
- How to abort saving data in save_extra_profile_fields function WordPress?
- Let Users Choose Post Categories
- Update user profile information from functions.php
- a:0:{} is replaced into database as s:6:”a:0:{}”;
- Read array in php?
- Countdown to date function?
- Getting users with a specific meta data and then querying their posts?
- How to update and save user metadata on page visits?
- Login redirect. Check user meta and redirect accordingly
- If Array Values Match Another Array’s Values, Then
- User Meta Value not echoing despite Var_Dump Showing correct string
- Shortcode for Listing Users from Meta Value?
- Getting different user data depending on where I use variable
- Adding Author Box Meta Links with Co-Authors
- Get the users that my following users are following
- Comapare get_user_meta value
- How can get all users by current user meta?
- Edit Account – read and write to MySQL
- Uses for function: wp_update_user
- Update user repeater meta (ACF) with another user meta field value
- Create condition for Author bio Social Links
- How to store checkbox data for individual users?
- How do I Populate a Table Field with User Meta Data?
- How to add and subtract user meta values after post meta update
- User meta needed in query is serialized – how to unserialize safely?
- Include User ID in iFrame URL
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- Usermeta data unserialize, extract and display in table in WordPress
- Change user metadata on registration (show_admin_bar_front = false)
- Store data from JavaScript object to custom table in user account
- Export WordPress User Meta to CSV/Excel
- Updating User Profile information removes image
- How to change the value of a variable using input field?
- Display current user metadata on WordPress page
- How Can I Display the Last Modified Date for User Profiles on WordPress?
- Get user by meta data key and velue
- Where do I implement this display of User Meta Data, and how to put it in a table?
- Update an additional user meta field with a string
- Add another role to a user when they click a button?
- Store custom field’s multiple values in one user meta key
- Get field in readable word
- not able to access $_POST on backend profile update
- Right way to display the_author_meta fields?
- Adding user meta to post meta wp_insert_post() not working
- Get meta_query value by user meta array
- Creating a custom register form
- get_users when from meta key that has serialized values
- How can get all users by current user meta (array)?
- Private messaging – Getting and displaying the avatar/url of a message recipient
- Updating custom user meta
- Updating meta_value in a custom key
- Limit the number of successful logins
- Get author meta of all writers
- Let users register weight each day and save it in DB
- Hide a nav menu item based on get_user_meta results
- A better way to write this php function
- Import users and custom user meta from csv
- Display only text to WordPress loop without loosing the text formatting
- How do I get images (with a thumbnail preview) to show in search results?
- PHPCS: Strings should have translatable content
- php syntax – how to concatenate properly – echo bloginfo(‘stylesheet_directory)
- Get_avatar filter?
- WooCommerce Tabs [closed]
- Show About and Contact Us page when they’re clicked in the top menu.
- Displaying posts based on category
- class ‘wphpc_PAnD’ not found
- Accessing values from ACF sub field (flexible content area) in PHP
- Creating an image from a custom field
- home.php show blog posts as grid view
- How to organize functions.php content
- Adding a ‘style=’ bit to image_send_to_editor output
- Inline CSS header style priority function.php Child (no enqueing I think)
- Jetengine Forms – Media upload path
- Checkbox is not being set
- Update $wpdb query with AJAX
- Send Notification to all users that followed some author
- loop to return tags in woocommerce in alphabetical order?
- Add title and caption to thumbnail image on mouseover
- Missing items on page
- WordPress blog set up
- Cannot get custom javascript to execute on page
- How to declare a variable at the bottom of the page and use its value at the top?
- WP and Laravel integration (Updated) [closed]