You appear to be a bot. Output may be restricted
Description
Schedule or deschedule the CRON jobMake sure that "oik_batchmove_hook" is scheduled or not. activated next_time action return false any unschedule false false false OK false true any nothing next_time true false schedule next_time from schedule
Usage
$time = oik_batchmove_schedule( $activated );
Parameters
- $activated
- ( bool ) optional – true if oik_batchmove_hook should be scheduled, false if it's supposed to be stopped
Returns
time the next scheduled time… if scheduled or false.Source
File name: oik-batchmove/admin/oik-batchmove-cron.phpLines:
1 to 27 of 27
function oik_batchmove_schedule( $activated=false ) { $next_time = wp_next_scheduled( 'oik_batchmove_hook' ); //if ( $next_time ) { bw_trace2( $next_time, date("Y-m-d H:i:s", $next_time) ); // p( "nt: $next_time" ); if ( $activated ) { if ( $next_time === false ) { // p( "Scheduling..." ); $next_time = oik_batchmove_schedule_event(); } else { // Good - we're scheduled //p( "Good. we're scheduled" ); } } else { if ( $next_time === false ) { // Good - we-re not scheduled // p( "Good, we're not scheduled" ); } else { // p( "Unscheduling..." ); // wp_unschedule_event( $next_time, 'oik_batchmove_hook' ); wp_clear_scheduled_hook( 'oik_batchmove_hook' ); $next_time = false; } } bw_trace2( $next_time, "next time?" ); return( $next_time ); }View on GitHub View on Trac