Changeset 33936
- Timestamp:
- 09/07/2015 02:38:12 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/cron.php
r32588 r33936 19 19 * @param string $hook Action hook to execute when cron is run. 20 20 * @param array $args Optional. Arguments to pass to the hook's callback function. 21 * @return void|false21 * @return false|void False when an event is not scheduled. 22 22 */ 23 23 function wp_schedule_single_event( $timestamp, $hook, $args = array()) { 24 // don't schedule a duplicate if there's already an identical event due within 10 minutes of it 24 // Make sure timestamp is a positive integer 25 if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) { 26 return false; 27 } 28 29 // Don't schedule a duplicate if there's already an identical event due within 10 minutes of it 25 30 $next = wp_next_scheduled($hook, $args); 26 31 if ( $next && abs( $next - $timestamp ) <= 10 * MINUTE_IN_SECONDS ) { 27 return ;32 return false; 28 33 } 29 34 … … 68 73 * @param string $hook Action hook to execute when cron is run. 69 74 * @param array $args Optional. Arguments to pass to the hook's callback function. 70 * @return false|void False when does not schedule event.75 * @return false|void False when an event is not scheduled. 71 76 */ 72 77 function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) { 78 // Make sure timestamp is a positive integer 79 if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) { 80 return false; 81 } 82 73 83 $crons = _get_cron_array(); 74 84 $schedules = wp_get_schedules(); … … 101 111 * @param string $hook Action hook to execute when cron is run. 102 112 * @param array $args Optional. Arguments to pass to the hook's callback function. 103 * @return false|void False when does not schedule event.113 * @return false|void False when an event is not scheduled. 104 114 */ 105 115 function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array() ) { 116 // Make sure timestamp is a positive integer 117 if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) { 118 return false; 119 } 120 106 121 $crons = _get_cron_array(); 107 122 $schedules = wp_get_schedules(); … … 149 164 */ 150 165 function wp_unschedule_event( $timestamp, $hook, $args = array() ) { 166 // Make sure timestamp is a positive integer 167 if ( ! is_numeric( $timestamp ) || $timestamp <= 0 ) { 168 return false; 169 } 170 151 171 $crons = _get_cron_array(); 152 172 $key = md5(serialize($args));
Note: See TracChangeset
for help on using the changeset viewer.