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  
    504504                $posts = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'"); 
    505505                if ( !empty($posts) ) 
    506506                        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)); 
    508508        } 
    509509        if ( $wp_current_db_version < 3570 ) { 
    510510                // Create categories for link categories if a category with the same 
  • wp-cron.php

    old new  
    1717                        do_action_ref_array($hook, $args['args']); 
    1818                        $schedule = $args['schedule']; 
    1919                        if ($schedule != false) { 
    20                                 $new_args = array_merge( array($timestamp, $schedule, $hook), $args['args']); 
     20                                $new_args = array($timestamp, $schedule, $hook, $args['args']); 
    2121                                call_user_func_array('wp_reschedule_event', $new_args); 
    2222                        } 
    2323                        wp_unschedule_event($timestamp, $hook, $args['args']); 
  • wp-includes/cron.php

    old new  
    11<?php 
    22 
    3 function wp_schedule_single_event( $timestamp, $hook ) { 
    4         $args = array_slice( func_get_args(), 2 ); 
     3function wp_schedule_single_event( $timestamp, $hook, $args = array()) { 
    54        $crons = _get_cron_array(); 
    65        $key = md5(serialize($args)); 
    76        $crons[$timestamp][$hook][$key] = array( 'schedule' => false, 'args' => $args ); 
     
    98        _set_cron_array( $crons ); 
    109} 
    1110 
    12 function wp_schedule_event( $timestamp, $recurrence, $hook ) { 
    13         $args = array_slice( func_get_args(), 3 ); 
     11function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) { 
    1412        $crons = _get_cron_array(); 
    1513        $schedules = wp_get_schedules(); 
    1614        $key = md5(serialize($args)); 
     
    2119        _set_cron_array( $crons ); 
    2220} 
    2321 
    24 function wp_reschedule_event( $timestamp, $recurrence, $hook ) { 
    25         $args = array_slice( func_get_args(), 3 ); 
     22function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array()) { 
    2623        $crons = _get_cron_array(); 
    2724        $schedules = wp_get_schedules(); 
    2825        $key = md5(serialize($args)); 
  • wp-includes/post.php

    old new  
    698698 
    699699        // Schedule publication. 
    700700        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)); 
    702702                 
    703703        do_action('save_post', $post_ID); 
    704704        do_action('wp_insert_post', $post_ID);