mirror of
git://develop.git.wordpress.org/
synced 2025-01-19 05:38:07 +01:00
Formatting and eol fixes.
git-svn-id: https://develop.svn.wordpress.org/trunk@3697 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
eda9ffad88
commit
0004abe8a7
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
function wp_schedule_single_event( $timestamp, $hook ) {
|
||||
$args = array_slice( func_get_args(), 2 );
|
||||
$crons = get_option( 'cron' );
|
||||
@ -6,6 +7,7 @@ function wp_schedule_single_event($timestamp, $hook) {
|
||||
ksort( $crons );
|
||||
update_option( 'cron', $crons );
|
||||
}
|
||||
|
||||
function wp_schedule_event( $timestamp, $recurrence, $hook ) {
|
||||
$args = array_slice( func_get_args(), 3 );
|
||||
$crons = get_option( 'cron' );
|
||||
@ -17,7 +19,6 @@ function wp_schedule_event($timestamp, $recurrence, $hook) {
|
||||
update_option( 'cron', $crons );
|
||||
}
|
||||
|
||||
|
||||
function wp_reschedule_event( $timestamp, $recurrence, $hook ) {
|
||||
$args = array_slice( func_get_args(), 3 );
|
||||
$crons = get_option( 'cron' );
|
||||
@ -34,9 +35,9 @@ function wp_reschedule_event($timestamp, $recurrence, $hook) {
|
||||
if ( 0 == $interval )
|
||||
return false;
|
||||
|
||||
while($timestamp < time() + 1) {
|
||||
while ( $timestamp < time() + 1 )
|
||||
$timestamp += $interval;
|
||||
}
|
||||
|
||||
wp_schedule_event( $timestamp, $recurrence, $hook );
|
||||
}
|
||||
|
||||
@ -57,15 +58,15 @@ function wp_next_scheduled($hook) {
|
||||
$crons = get_option( 'cron' );
|
||||
if ( empty($crons) )
|
||||
return false;
|
||||
foreach($crons as $timestamp => $cron) {
|
||||
//if($timestamp <= time()) continue;
|
||||
if(isset($cron[$hook])) return $timestamp;
|
||||
}
|
||||
foreach ( $crons as $timestamp => $cron )
|
||||
if ( isset( $cron[$hook] ) )
|
||||
return $timestamp;
|
||||
return false;
|
||||
}
|
||||
|
||||
function spawn_cron() {
|
||||
if (array_shift(array_keys(get_option('cron'))) > time()) return;
|
||||
if ( array_shift( array_keys( get_option( 'cron' ) ) ) > time() )
|
||||
return;
|
||||
|
||||
$cron_url = get_settings( 'siteurl' ) . '/wp-cron.php';
|
||||
$parts = parse_url( $cron_url );
|
||||
@ -102,4 +103,5 @@ function wp_get_schedules() {
|
||||
);
|
||||
return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
|
||||
}
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user