Get frequency of scheduled event

This is an old question, but hopefully this helps someone facing the same issue. We can use wp_get_schedule( $hook ) to retrieve the cron schedule for the hook. Then we can use wp_get_schedules() to retrieve the supported cron recurrences. Find the correct array value and return it. /** * Retrieve Cron interval for hook. * … Read more

wp-cron.php is triggered, but scheduled post is not published

The _get_cron_array() function gets the ‘cron’ option out of the database. The cron option contains an array consisting of a series of unix-timestamps and action hooks. So, when the timestamp is reached, then the action hook is called. The timestamp of 1465529020 is the equivalent of June 10th, 2016, at 3:23am in UTC time. The … Read more

Run WP Cron Weekly (but on a certain day)

WP-Cron is not intended to be that precise, and should not be used if you have to have things scheduled at specific times. WP-Cron is a “best effort” scheduling mechanism, and it cannot guarantee run timing like a real cron system can. If you need precision of this nature, the only real answer is to … Read more

add_action to wp cron?

Basically every page load looks to see if there is anything scheduled to run, so by that logic the cron is checked and can possibly run on every page load. I can only presume you want to schedule something to run every so often. If that’s the case you need to look at wp_schedule_event() Below … Read more

wp_schedule_event won’t accept args

This is not a fix for your problem, but it might lead you in the right direction to solving the issue. I would suggest checking out this plugin to possibly help you find out what is going on: WP Cron Control It offers a quick view of cron jobs scheduled throughout your site. I recently … Read more

How to use wp_schedule_event in a class?

Add an action outside your class definition: add_action(‘my_unique_plugin_event_hook’, array($this,’hook’)); And then use this in your event: wp_schedule_event(time(), ‘daily’, ‘my_unique_plugin_event_hook’);

Using wp_schedule_single_event with arguments to send email

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 … Read more

WordPress cron isn’t scheduled on amazon web services

As a general principal, you shouldn’t do anything that requires an ‘add_action’ after the plugin activation hook. This is because WP loads and runs all plugins and THEN runs the new added one, and then does a re-direct. You have to set a DB option and hook into that. Here is the discussion from the … Read more