WordPress.org

Ready to get started?Download WordPress

Forums

wp_next_scheduled() returns timestamp, not scheduled time (2 posts)

  1. maccast
    Member
    Posted 2 years ago #

    When I call wp_next_scheduled() instead of getting the timestamp plus the recurrance interval, the function appears to just return the timestamp. The timestamp is the value set by the wp_schedule_event() method and is the UNIX timestamp of when the event was scheduled. Since wp_next_scheduled() is supposed to: "Returns the next timestamp for a cron event." shouldn't return the timestamp + recurrence interval value?

  2. Brian Layman
    Member
    Posted 2 years ago #

    When you schedule the event, an immediate call to wp_next_scheduled() will return the original scheduling time (or perhaps even earlier if the event already existed).

    Calls to wp_next_scheduled() after the event first fires should always be future times. The only exception to that rule would be cron events that fire late due to an extremely overloaded server or possibly ( I suspect ) a custom scheduled time that is too short for use on an infrequently visited site.

Topic Closed

This topic has been closed to new replies.

About this Topic