I think you have mismatch in how you pass arguments and how you expect it to work. You pass array of arguments to schedule and expect your hooked function to receive identical array of arguments. This is not the case.
Cron events are processed by do_action_ref_array()
, which in turn passes arguments via call_user_func_array()
.
So your hooked function does not receive array of arguments, it receives multiple arguments – one for each element in your array.
So you need to either wrap array of arguments in array one more time or modify your function to process multiple arguments. Note that for letter you will also need to modify your add_action()
call so that required number of arguments is passed instead of just one.
Related Posts:
- How to make WordPress emails async
- Sending email to all users
- Send Weekly Email if Users have not complete their profiles
- Email alert with wp_cron and wp_mail if new data (external API) – Pseudo code
- Sending emails to separate accounts using a for loop
- Not getting expected email when running cron hook
- Should I disable WP_CRON and instead trigger wp-cron.php from server every few mins?
- Do WordPress cron jobs slow down page loading?
- PHP Warning on fresh install (Connection timed out)
- Is there a known vulnerability for wp-cron.php?
- WordPress cron isn’t scheduled on amazon web services
- How to use wp_schedule_event in a class?
- Run WP Cron Weekly (but on a certain day)
- wp_schedule_event() on specific time, daily
- wp_next_scheduled returning a past timestamp
- Do wp-cron scheduled tasks run asynchronously?
- WP CRON runs only the first time
- Run a cron job (or similar) in the background of WP after post update/create
- wp-cron still running even though DISABLE_WP_CRON is true
- How to set up WP Cron in this scenario
- WP-Cron tasks scheduled but not running
- Can’t find wp-cron.php but I can see it in the public folder [closed]
- WordPress wp-cron not working
- Why cron doesn’t work to me?
- Wp cron event is set but the function isn’t getting fired
- Is doing_wp_cron a necessary query string when scheduling cron.php as a cron job?
- Run a php file daily at specific time
- Scheduling posts on wordpress adds wrong seconds as post_date
- WordPress Cron is scheduled but not running
- How to execute existing WP Cron programmatically
- Cleaning “cron” from options table, will affect anything?
- debugging wp_cron jobs with XDebug in Eclipse
- wp_schedule_event run in background or not?
- How to code schedule / cron job
- Cron schedule not updating after run
- How to schedule and publish a post after it’s ready?
- Can you register two cron events in a single function?
- wp_schedule_single_event does not call my action
- wp-cron.php – timeout
- Failed to open stream: HTTP request failed! in \wamp\www\wordpress\wp-includes\class-http.php on line 929
- WP Cron jobs loops infinitely
- Scheduling a cron job from a function that is ran outside functions.php?
- wp-cron behaviour when there are multiple queued tasks
- Why is `wp_unschedule_event` not working
- WordPress action hooks related to scheduled posts not Fired
- Cron Job Keep Running in spite of being disabled
- How to create a WP Cron hooks based on schedules from Advanced cron manager plugin?
- Cron job not working – Can’t see in the queue attached
- How to force ‘cron_schedules’ every minute instead 1 hour?
- WordPress, how to run a function every 12 december?
- When running WordPress Cron manually, it shows WP-Cron spawning is disabled. What is WP-Cron spawning?
- Cron job to run just once per day using external cron service
- How to know if a script started by wp_cron is still active?
- wp_schedule_event – function won’t execute
- WordPress cron creation during plugin installation results with initial execution
- WordPress cron hooks – same callback for completely different action?
- Manually running cron from the server
- How to solve cron problem in WordPress?
- Cron jobs when running multiple instances on the same DB
- WordPress Cron job, 302 response
- How to periodically roll back WordPress to a fixed point in time?
- my wp schedule event is not working
- WP-Cron function not firing
- WP Cron scheduling doesn’t work reliably on hosted server
- Time limit on long cron job?
- Call to undefined function wp_create_category()
- WP-Cron called by separate server
- WP_cron keeps going back to the past
- Cron and request with wp_remote_post
- Real cron killed my cron system. Only define( ‘ALTERNATE_WP_CRON’, true ); works
- Unknown requests on my WP Site
- wp_schedule_event doesn’t work
- WordPress CRON job working when reloading the page
- Cron not sending wp-mail()
- What am I doing wrong creating post draft via wp-cron? (wp_schedule_event & wp_insert_post)
- WP cron and update post meta
- WP-Cron system doesn’t work on server
- Cron Job Scheduling in wordpress
- Schedule reminder at exact time
- Schedule Removal of Menu Page and Shortcode
- daily job to run send email based on user data
- Huge cron option_value into wp_options table
- automatic send email at custom time
- setting up a wp cron job
- Cron Lock Timeout, when to use?
- Regenerating array key for wp_schedule_event args
- WP cron Executes once and doesnt repeat
- wp-cron not working
- how to crate cronjo not depending on user access
- Cron event running more than once if triggered from WP Crontrol
- Cron job for wp_cron.php running but not publishing scheduled posts
- How to know if WP cron is currently running my hook?
- wp_privacy_delete_old_export_files, failed to run
- Working function() doesn’t execute when triggered by WP CRON
- Change a Post’s Status based on the date from a custom field? (for Event posts)
- Multiple conditional logic in Custom Event In WP_ Cron not working
- Definition of page load for WP-Cron?
- Custom cronjob not executing at all, but manually
- Protect wp-cron from hackers
- ‘wp_site_health_scheduled_check’ Causes Failure Of Other Scripts