[wp-hackers] Cron Tasks doesn't update_options
otto at ottodestruct.com
Mon Mar 21 22:16:22 UTC 2011
You're using wp_schedule_event incorrectly.
wp_schedule_event(time(), 'minute', 'cron_plugin_action');
The third parameter is an *action*, not a callback function name.
Later you have this code:
/* Cron function */
update_option( 'cron_plugin_time', time() );
In order for that to work, you would also need:
In order to hook the action name to the function name.
Basically, your function is never being run.
On Mon, Mar 21, 2011 at 5:12 PM, Craig Russell
<craig at craig-russell.co.uk> wrote:
> It seems like cronned tasks can't update options in my setup.
> I've written a basic plugin to illustrate the effect here
> The plugin simply updates a stored option to the current time each
> time it is run.
> The settings page of the plugin shows the scheduled time for the task
> to run (which updates) and the stored time (which does not update).
> Am I overlooking something in my configuration?
> Are there any special server configs for cron to run correctly?
> Or is this a more general problem with cron? (probably not this)
> Any help greatly appreciated.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers