Changeset 47122 for trunk/src/wp-includes/cron.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/cron.php
r47088 r47122 33 33 */ 34 34 function wp_schedule_single_event( $timestamp, $hook, $args = array() ) { 35 // Make sure timestamp is a positive integer 35 // Make sure timestamp is a positive integer. 36 36 if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) { 37 37 return false; … … 143 143 $event = apply_filters( 'schedule_event', $event ); 144 144 145 // A plugin disallowed this event 145 // A plugin disallowed this event. 146 146 if ( ! $event ) { 147 147 return false; … … 187 187 */ 188 188 function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array() ) { 189 // Make sure timestamp is a positive integer 189 // Make sure timestamp is a positive integer. 190 190 if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) { 191 191 return false; … … 215 215 $event = apply_filters( 'schedule_event', $event ); 216 216 217 // A plugin disallowed this event 217 // A plugin disallowed this event. 218 218 if ( ! $event ) { 219 219 return false; … … 252 252 */ 253 253 function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array() ) { 254 // Make sure timestamp is a positive integer 254 // Make sure timestamp is a positive integer. 255 255 if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) { 256 256 return false; … … 308 308 } 309 309 310 // Now we assume something is wrong and fail to schedule 310 // Now we assume something is wrong and fail to schedule. 311 311 if ( 0 == $interval ) { 312 312 return false; … … 342 342 */ 343 343 function wp_unschedule_event( $timestamp, $hook, $args = array() ) { 344 // Make sure timestamp is a positive integer 344 // Make sure timestamp is a positive integer. 345 345 if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) { 346 346 return false; … … 399 399 */ 400 400 function wp_clear_scheduled_hook( $hook, $args = array() ) { 401 // Backward compatibility 402 // Previously this function took the arguments as discrete vars rather than an array like the rest of the API401 // Backward compatibility. 402 // Previously, this function took the arguments as discrete vars rather than an array like the rest of the API. 403 403 if ( ! is_array( $args ) ) { 404 404 _deprecated_argument( __FUNCTION__, '3.0.0', __( 'This argument has changed to an array to match the behavior of the other cron functions.' ) ); … … 427 427 } 428 428 429 // This logic duplicates wp_next_scheduled() 430 // It's required due to a scenario where wp_unschedule_event() fails due to update_option() failing, 431 // and, wp_next_scheduled() returns the same schedule in an infinite loop. 429 /* 430 * This logic duplicates wp_next_scheduled(). 431 * It's required due to a scenario where wp_unschedule_event() fails due to update_option() failing, 432 * and, wp_next_scheduled() returns the same schedule in an infinite loop. 433 */ 432 434 $crons = _get_cron_array(); 433 435 if ( empty( $crons ) ) { … … 649 651 } 650 652 651 // don't run if another process is currently running it or more than once every 60 sec.653 // Don't run if another process is currently running it or more than once every 60 sec. 652 654 if ( $lock + WP_CRON_LOCK_TIMEOUT > $gmt_time ) { 653 655 return false; 654 656 } 655 657 656 // sanity check658 // Sanity check. 657 659 $crons = wp_get_ready_cron_jobs(); 658 660 if ( empty( $crons ) ) { … … 677 679 echo ' '; 678 680 679 // flush any buffers and send the headers681 // Flush any buffers and send the headers. 680 682 wp_ob_end_flush_all(); 681 683 flush(); … … 744 746 */ 745 747 function wp_cron() { 746 // Prevent infinite loops caused by lack of wp-cron.php 748 // Prevent infinite loops caused by lack of wp-cron.php. 747 749 if ( strpos( $_SERVER['REQUEST_URI'], '/wp-cron.php' ) !== false || ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) ) { 748 750 return 0; … … 924 926 925 927 // 926 // Private functions 928 // Private functions. 927 929 // 928 930
Note: See TracChangeset
for help on using the changeset viewer.