• I’m having a problem writing a plugin.

    The plugin calls the following 2 wordpress functions:

    …code before…

    wp_clear_scheduled_hook( 'publish_future_post', $ID );
    wp_schedule_single_event(strtotime($post_date_gmt. ' GMT'), 'publish_future_post', array($ID));

    …code after…

    SOMETIMES the above 2 lines of code DOESN’T work. When I check the options table and the cron, the post with an id of ID doesn’t appear in the cron row.

    HOWEVER, I know the …code after… is being called EVERY TIME without fail, even though the wp_schedule_single_event function seems to be failing.

    I have no idea what is wrong and why the wp_schedule_single_event fails “randomly” however parsing control back to the rest of the function.

    Please help somebody.

Viewing 1 replies (of 1 total)
  • Thread Starter idealists

    (@idealists)

    where post_date_gmt = gmdate(“Y-m-d H:i:s”,$some_timestmp);
    and $ID is the id past to the function by xmlrpc_publish_post action

Viewing 1 replies (of 1 total)
  • The topic ‘Problem with wp_schedule_single_event’ is closed to new replies.