class checkPost{
function __construct()
{
if ( !wp_next_scheduled('my_task_hook') ) {
wp_schedule_event( time(), 'hourly', 'my_task_hook' ); // hourly, daily and twicedaily
}
add_action('my_task_hook', array(&$this,'my_task_function'));
}
function my_task_function()
{
add_action('wp_head', array(&$this,'wp_head'));
}
function wp_head()
{
echo '<!--This is a test!-->';
}
}
That's the stripped code of my plugin, but it's somehow not working. Why is it not?
wp-cron.phpseems to have some issues since 3.3; I found several threads of people complaining. My own posts miss schedule since then, too. No idea. – Raphael Jan 26 '12 at 20:33