Please read carefully about wp_schedule_single_event in Codex. As you can see, there is a third argument $args.
You can schedule a singule WP_Cron event by modifying the function you use above and passing arguments as third parameter:
<?php
// Your basic hook schelduling...
wp_schedule_single_event( time() + 30, 'user_cron_event',
array(
'user_id' => $user_id,
'oldmoney' => $oldmoney,
'totalprice' => $totalprice
)
);
and your base action in this case…
add_action('user_cron_event', 'user_cron_event_callback');
function user_cron_event_callback($args){
update_user_meta( $args['user_id'], 'money', $args['oldmoney']-$args['totalprice']);
}
Related Posts:
- How to represent “event” in a UML Class Diagram?
- How to test wp_cron?
- Recommendation for a WordPress Calendar Plugin with Recurring Events? [closed]
- Post date vs. event date in WordPress
- Looking for a simple calendar/events plugin [closed]
- Create a custom event post
- Show events date instead of article date in default calendar widget
- how to set array of args for scheduled event?
- Events plugin for irregular / complex events [closed]
- How to get an event to fire using Google Tag Manager for the wordpress audio player?
- Event Organiser: Event list includes regular Posts & custom fields? [closed]
- Single Events as Sub-Page to Main Calendar Page
- Reverse order of events on homepage [closed]
- Event booking form for wordpress
- Plugin: Events manager – Next and previous event
- Event Management plugin
- How to Create Events Calendar
- Group the events post in month+year format?
- how can create carousel for posts that will be published a month later?
- Upcoming events
- Add option in th event calendar
- Post Terms As Class Name For Full Calendar Events
- What does on() in JavaScript do?
- Jquery .on(‘scroll’) not firing the event while scrolling
- How to block until an event is fired in c#
- jQuery multiple events to trigger the same function
- onKeyDown event not working on divs in React
- Fire oninput event with jQuery
- Why onbeforeunload event is not firing
- WordPress Media Uploader events
- trigger save_post event programmatically
- How to capture the selection:toggle event fired by wp.media
- Only Showing Upcoming Events
- How to create collections that are edited in admin?
- All-in-One Event Calendar: Custom Query – Getting each event Instance [closed]
- Is there a WordPress Event Manager that links with your user database?
- How to trap “Publish” button to check for meta box validation?
- sort events based on event date custom field
- Archive by custom post type and custom date field
- How can I invoke an action after a CiviCRM triggering event?
- Conference ticketing and seating module for WordPress [closed]
- Plugin allowing for artists, events and venues
- 1 day after custom date change post status to draft
- Looking for a subscriber list management system
- Why is wp-cron only executing on page visit?
- Trigger background job using AJAX
- How to select events within current week using wp_query
- Plugin: Events Manager – Search by start date only
- RSVP form for Facebook events from a WordPress post?
- Save metadata as a timestamp, display as a “pretty” date
- Sorting WordPress Posts via Custom Field Values?
- How to display upcoming events by dat with Modern Events Calendar Lite
- Display posts with a start OR end date later than current date
- Calendar Solution: Handling upcoming Dates with Posts?
- Events Plugin that works with existing categories?
- How to order posts by one custom field and filter them by another one?
- List of JS Events for Widgets?
- Redux callback action
- How do I search events between two set dates inside WP?
- Creating a Custom Post Type and Joining with Users
- Integrating Facebook calender to WordPress
- Select event where start date is smaller than current date and end date is greater than current date
- Trying to create a table/list of my EventBrite course listings [closed]
- Issue with wp_schedule_event()
- FYI: How to make Time.ly all-in-one event calendar mobile friendly [closed]
- sort and display posts by custom field (wp-query and the loop))
- How to Configure Events List in WordPress to Disappear Event Once Date is Past
- Should i use a plugin for Event Manager or code my own needs? [closed]
- WooCommerce event works in jQuery but not in JavaScript
- the ‘save_post’ event triggers when I want to start a new post
- List of Events with Multiple Dates: Only NEXT Date
- Update Post Taxonomy Automatically Based On Date
- When using Tribe Events Calendar, querying for a specific event category returns nothing
- Order posts of a custom post type by the event date using FT Calendar Plugin
- how to compare different timestamps in wp-query for events custom post types?
- Creating an Events Feed with Sub Pages/Posts for Each Event
- Display upcoming events in the next 30 days by querying posts with timestamp in custom meta
- Membership & Event Registration/Management plus-ins for non-profit [closed]
- Can’t see past events on admin dashboard
- Is there a way to know when a page has been updated and do some action only once?
- Ordering of posts, 2020 Year showing as next event when should be last
- profile_update hook does not fire from front-end
- Permalinks don’t update nor link properly
- EventON – Dequeue Styles
- Execute jQuery with custom event listener after successfully add an item to the cart
- How to populate a Mailchimp newsletter with latest events from WordPress plugin EventOn?
- Hourly events don’t get triggered
- DOM reference to TinyMCE editor element (button)
- Include custom table in query
- Events with multiple event dates + permalink for each date
- Sorting meta box values by start- and enddate and all dates in between
- Checking if field is set before comparing with meta_query in query_posts?
- Unable to sort wp_query by date/time with multiple meta_key s
- Count of posts with meta_key filled in?
- Display content based on an event
- Plugin for Marathon Running Event Management [closed]
- Custom booking form field not saving
- How to write a plugin that “listens” every time, an edit occurs?
- What would be the optimal CPT / Taxonomy design for the following entities structure
- I am trying to implement some logic on real time order sync using scheduler