Ticket #3169: psuedo-cron-no-nested-array.2.diff
| File psuedo-cron-no-nested-array.2.diff, 3.0 kB (added by masquerade, 2 years ago) |
|---|
-
wp-admin/upgrade-functions.php
old new 504 504 $posts = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'"); 505 505 if ( !empty($posts) ) 506 506 foreach ( $posts as $post ) 507 wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', $post->ID);507 wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', array($post->ID)); 508 508 } 509 509 if ( $wp_current_db_version < 3570 ) { 510 510 // Create categories for link categories if a category with the same -
wp-cron.php
old new 17 17 do_action_ref_array($hook, $args['args']); 18 18 $schedule = $args['schedule']; 19 19 if ($schedule != false) { 20 $new_args = array _merge( array($timestamp, $schedule, $hook), $args['args']);20 $new_args = array($timestamp, $schedule, $hook, $args['args']); 21 21 call_user_func_array('wp_reschedule_event', $new_args); 22 22 } 23 23 wp_unschedule_event($timestamp, $hook, $args['args']); -
wp-includes/cron.php
old new 1 1 <?php 2 2 3 function wp_schedule_single_event( $timestamp, $hook ) { 4 $args = array_slice( func_get_args(), 2 ); 3 function wp_schedule_single_event( $timestamp, $hook, $args = array()) { 5 4 $crons = _get_cron_array(); 6 5 $key = md5(serialize($args)); 7 6 $crons[$timestamp][$hook][$key] = array( 'schedule' => false, 'args' => $args ); … … 9 8 _set_cron_array( $crons ); 10 9 } 11 10 12 function wp_schedule_event( $timestamp, $recurrence, $hook ) { 13 $args = array_slice( func_get_args(), 3 ); 11 function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) { 14 12 $crons = _get_cron_array(); 15 13 $schedules = wp_get_schedules(); 16 14 $key = md5(serialize($args)); … … 21 19 _set_cron_array( $crons ); 22 20 } 23 21 24 function wp_reschedule_event( $timestamp, $recurrence, $hook ) { 25 $args = array_slice( func_get_args(), 3 ); 22 function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array()) { 26 23 $crons = _get_cron_array(); 27 24 $schedules = wp_get_schedules(); 28 25 $key = md5(serialize($args)); -
wp-includes/post.php
old new 698 698 699 699 // Schedule publication. 700 700 if ( 'future' == $post_status ) 701 wp_schedule_single_event(strtotime($post_date_gmt. ' GMT'), 'publish_future_post', $post_ID);701 wp_schedule_single_event(strtotime($post_date_gmt. ' GMT'), 'publish_future_post', array($post_ID)); 702 702 703 703 do_action('save_post', $post_ID); 704 704 do_action('wp_insert_post', $post_ID);
