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
|
<?php
|
||||||
|
|
||||||
function wp_schedule_single_event( $timestamp, $hook ) {
|
function wp_schedule_single_event( $timestamp, $hook ) {
|
||||||
$args = array_slice( func_get_args(), 2 );
|
$args = array_slice( func_get_args(), 2 );
|
||||||
$crons = get_option( 'cron' );
|
$crons = get_option( 'cron' );
|
||||||
@ -6,6 +7,7 @@ function wp_schedule_single_event($timestamp, $hook) {
|
|||||||
ksort( $crons );
|
ksort( $crons );
|
||||||
update_option( 'cron', $crons );
|
update_option( 'cron', $crons );
|
||||||
}
|
}
|
||||||
|
|
||||||
function wp_schedule_event( $timestamp, $recurrence, $hook ) {
|
function wp_schedule_event( $timestamp, $recurrence, $hook ) {
|
||||||
$args = array_slice( func_get_args(), 3 );
|
$args = array_slice( func_get_args(), 3 );
|
||||||
$crons = get_option( 'cron' );
|
$crons = get_option( 'cron' );
|
||||||
@ -17,7 +19,6 @@ function wp_schedule_event($timestamp, $recurrence, $hook) {
|
|||||||
update_option( 'cron', $crons );
|
update_option( 'cron', $crons );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function wp_reschedule_event( $timestamp, $recurrence, $hook ) {
|
function wp_reschedule_event( $timestamp, $recurrence, $hook ) {
|
||||||
$args = array_slice( func_get_args(), 3 );
|
$args = array_slice( func_get_args(), 3 );
|
||||||
$crons = get_option( 'cron' );
|
$crons = get_option( 'cron' );
|
||||||
@ -34,9 +35,9 @@ function wp_reschedule_event($timestamp, $recurrence, $hook) {
|
|||||||
if ( 0 == $interval )
|
if ( 0 == $interval )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
while($timestamp < time() + 1) {
|
while ( $timestamp < time() + 1 )
|
||||||
$timestamp += $interval;
|
$timestamp += $interval;
|
||||||
}
|
|
||||||
wp_schedule_event( $timestamp, $recurrence, $hook );
|
wp_schedule_event( $timestamp, $recurrence, $hook );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,15 +58,15 @@ function wp_next_scheduled($hook) {
|
|||||||
$crons = get_option( 'cron' );
|
$crons = get_option( 'cron' );
|
||||||
if ( empty($crons) )
|
if ( empty($crons) )
|
||||||
return false;
|
return false;
|
||||||
foreach($crons as $timestamp => $cron) {
|
foreach ( $crons as $timestamp => $cron )
|
||||||
//if($timestamp <= time()) continue;
|
if ( isset( $cron[$hook] ) )
|
||||||
if(isset($cron[$hook])) return $timestamp;
|
return $timestamp;
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function spawn_cron() {
|
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';
|
$cron_url = get_settings( 'siteurl' ) . '/wp-cron.php';
|
||||||
$parts = parse_url( $cron_url );
|
$parts = parse_url( $cron_url );
|
||||||
@ -102,4 +103,5 @@ function wp_get_schedules() {
|
|||||||
);
|
);
|
||||||
return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
|
return array_merge( apply_filters( 'cron_schedules', array() ), $schedules );
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user