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
- Is there a quick way to view the wp-cron schedule
- 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
- wp_schedule_event is executing but the function related to the hook is not running
- How to use wp_schedule_event in a class?
- wp_schedule_event won’t accept args
- add_action to wp cron?
- Triggering cron by calling wp-cron.php on the command line rather than with wget?
- Run WP Cron Weekly (but on a certain day)
- wp-cron.php is triggered, but scheduled post is not published
- Get frequency of scheduled event
- wp_schedule_event() on specific time, daily
- wp_next_scheduled returning a past timestamp
- crontab wp-cron.php on multisite path-based network: one for each path? Or just one for the root?
- Missed scheduled WordPress
- Running wp-cron from CLI
- Do wp-cron scheduled tasks run asynchronously?
- Some rogue WordPress plugin killing my server – how do I isolate and kill it?
- Why?: hundreds of empty files named wp-cron.php?doing_wp_cron.
- Can’t access wp_filesystem in cron function
- WP CRON runs only the first time
- Run a cron job (or similar) in the background of WP after post update/create
- what is firing cron
- wp-cron still running even though DISABLE_WP_CRON is true
- Managing scheduled tasks
- custom cron interval is not working
- How to set up WP Cron in this scenario
- Where in the page load code is wp-cron triggered?
- WP-Cron tasks scheduled but not running
- Can’t find wp-cron.php but I can see it in the public folder [closed]
- Manually trigger a wp_schedule_event item?
- Check if event was scheduled – schedule event only once
- wp_get_schedule and wp_next_scheduled don’t find my scheduled wp-cron job
- Getting Error “invalid secret string” by running wp-cron.php manually
- WordPress wp-cron not working
- Too many wp-cron requests even when disabled
- Why cron doesn’t work to me?
- Why would wp_schedule_single_event get delayed start?
- 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
- Create function in functions.php with hook name to execute URL
- cron.php being constantly deleted [closed]
- 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?
- Execute code at the end of each quarter of year
- debugging wp_cron jobs with XDebug in Eclipse
- wp_schedule_event run in background or not?
- Trigger background job using AJAX
- Detect if Cron is Running
- Run function with linux cron job in WordPress
- Schedule cron don’t work
- How to code schedule / cron job
- wp_schedule_event daily at specific time
- Pings disabled but WordPress is still searching for “to_ping”
- 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
- Hourly scheduled wp_cron job keeps getting rescheduled
- When to use wp_schedule_single_event for async / non-blocking processes?
- 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: freeze at “now”
- How could an event previously scheduled with wp_schedule_event later become unscheduled?
- daily wp_schedule_event hook works after reload any page
- update post every day
- WP Cron jobs loops infinitely
- Scheduling a cron job from a function that is ran outside functions.php?
- Issues When Recursively Calling wp_schedule_single_event()
- Sync user meta fields using Wp cron job
- wp-cron behaviour when there are multiple queued tasks
- Why is `wp_unschedule_event` not working
- System Cron job not firing
- WordPress Cron Job Not working
- WordPress action hooks related to scheduled posts not Fired
- Cron Job Keep Running in spite of being disabled
- WordPress automatic publish: is there a timeout when WordPress won’t publish anymore?
- 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 fix missing function in wp-cron?
- “Missed schedule” posting bug
- Run function after a post has finished saving – callback function perhaps?
- How to force ‘cron_schedules’ every minute instead 1 hour?
- WordPress, how to run a function every 12 december?
- Cancel/Stop a currently ongoing scheduled cron event?
- When running WordPress Cron manually, it shows WP-Cron spawning is disabled. What is WP-Cron spawning?
- Wp Cron and WordPress Updates
- Code does not work in class implementation but works fine in functions.php file