Because you’re scheduling the event – even though it’s set to run immediately (i.e. with time()
), it won’t fire until a second request.
So that log output is entirely expected. Try running it again, removing the code, then run once more – you should get:
[time] test_action
Related Posts:
- Is there a quick way to view the wp-cron schedule
- Triggering cron by calling wp-cron.php on the command line rather than with wget?
- wp-cron.php is triggered, but scheduled post is not published
- 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
- Some rogue WordPress plugin killing my server – how do I isolate and kill it?
- what is firing cron
- Managing scheduled tasks
- custom cron interval is not working
- 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
- WordPress wp-cron not working
- Too many wp-cron requests even when disabled
- Why would wp_schedule_single_event get delayed start?
- Create function in functions.php with hook name to execute URL
- cron.php being constantly deleted [closed]
- 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”
- Can you register two cron events in a single function?
- Hourly scheduled wp_cron job keeps getting rescheduled
- When to use wp_schedule_single_event for async / non-blocking processes?
- 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
- Issues When Recursively Calling wp_schedule_single_event()
- Sync user meta fields using Wp cron job
- System Cron job not firing
- WordPress Cron Job Not working
- WordPress automatic publish: is there a timeout when WordPress won’t publish anymore?
- How to fix missing function in wp-cron?
- “Missed schedule” posting bug
- Run function after a post has finished saving – callback function perhaps?
- Cancel/Stop a currently ongoing scheduled cron event?
- Wp Cron and WordPress Updates
- Code does not work in class implementation but works fine in functions.php file
- Use cron to create a non blocking task
- How to create and run cronjob in WP without using the plugin?
- Issue with wp_schedule_event()
- Why is apache access log not showing GET requests related to cron job?
- How to solve cron problem in WordPress?
- Cron jobs when running multiple instances on the same DB
- When does wp-cron fire?
- Scheduling WP cron jobs
- WP-Cron system broken
- what effective ways are there to debug cron
- How do i set cron job for my WordPress site?
- Hook/Cron Problem
- How can I prove if wp cron is running my task if I have DISABLE_WP_CRON set to true
- Delete all users when they don’t update profile_fields
- Email alert with wp_cron and wp_mail if new data (external API) – Pseudo code
- wp_schedule_event is registered but scheduled function isn’t running
- Strange cron job behavior and how to solve it?
- WordPress cron not getting executed when called by external service (but ok from browser)
- Compare time value in WP_User_Query for sending emails
- Diagnosing WP-Cron jobs locking up my server
- How to run correctly wordpress cron from Cpanel
- How to Set a Condition via Page Template Name in WP Cron Job?
- wp-cron.php not being triggered by wp_remote_post in spawn_cron()
- Server cron job not working
- Schedule several instances of the same action with cron
- wp_schedule_event doesn’t work
- Trying to configure cron to get next value from array on each run
- Run function at a specific time of a day
- Most efficient way to trigger wp-cron through system cron.
- How to make sure WP-CRON job loops through all posts?
- WordPress Multisite cron jobs using cron tab
- Run external file cron using WordPress Scheduler
- WP Cron: wp_get_schedule( $hook ) returns nothing
- Schedule reminder at exact time
- wp-cron function not running when activating the cron by form submit
- couldn’t connect to host – wp-cron.php?doing_wp_cron
- Run WordPress Plugin in the Specified time
- Pages for Cron use Only?
- Make posts automatically from an Online XML file through wp cron job
- Cron jobs repeating themselves
- WordPress Cron Job Counting Up and Not Down
- WP Cron fail to update the next_schedule
- Run cronjob with browser request
- Does DISABLE_WP_CRON prevent plugins from registering new cron tasks?
- 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
- How to Auto Update WordPress Post after specific time?
- 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