Fix handling of old timestamps in wp_reschedule_event(). Props natethelen. fixes #9318
git-svn-id: http://svn.automattic.com/wordpress/trunk@10969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
097b84333d
commit
6c8badc7c7
|
@ -88,8 +88,12 @@ function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array()) {
|
|||
if ( 0 == $interval )
|
||||
return false;
|
||||
|
||||
while ( $timestamp < time() + 1 )
|
||||
$timestamp += $interval;
|
||||
$now = time();
|
||||
|
||||
if ( $timestamp >= $now )
|
||||
$timestamp = $now + $interval;
|
||||
else
|
||||
$timestamp = $now + ($interval - (($now - $timestamp) % $interval));
|
||||
|
||||
wp_schedule_event( $timestamp, $recurrence, $hook, $args );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue