Change cron arg passing. Props masquerade. fixes #3169.
git-svn-id: http://svn.automattic.com/wordpress/trunk@4362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
df47e48d7c
commit
287467334e
|
@ -503,7 +503,7 @@ function upgrade_210() {
|
|||
$posts = $wpdb->get_results("SELECT ID, post_date FROM $wpdb->posts WHERE post_status ='future'");
|
||||
if ( !empty($posts) )
|
||||
foreach ( $posts as $post )
|
||||
wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', $post->ID);
|
||||
wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', array($post->ID));
|
||||
}
|
||||
if ( $wp_current_db_version < 3570 ) {
|
||||
// Create categories for link categories if a category with the same
|
||||
|
|
|
@ -17,7 +17,7 @@ foreach ($crons as $timestamp => $cronhooks) {
|
|||
do_action_ref_array($hook, $args['args']);
|
||||
$schedule = $args['schedule'];
|
||||
if ($schedule != false) {
|
||||
$new_args = array_merge( array($timestamp, $schedule, $hook), $args['args']);
|
||||
$new_args = array($timestamp, $schedule, $hook, $args['args']);
|
||||
call_user_func_array('wp_reschedule_event', $new_args);
|
||||
}
|
||||
wp_unschedule_event($timestamp, $hook, $args['args']);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
|
||||
function wp_schedule_single_event( $timestamp, $hook ) {
|
||||
$args = array_slice( func_get_args(), 2 );
|
||||
function wp_schedule_single_event( $timestamp, $hook, $args = array()) {
|
||||
$crons = _get_cron_array();
|
||||
$key = md5(serialize($args));
|
||||
$crons[$timestamp][$hook][$key] = array( 'schedule' => false, 'args' => $args );
|
||||
|
@ -9,8 +8,7 @@ function wp_schedule_single_event( $timestamp, $hook ) {
|
|||
_set_cron_array( $crons );
|
||||
}
|
||||
|
||||
function wp_schedule_event( $timestamp, $recurrence, $hook ) {
|
||||
$args = array_slice( func_get_args(), 3 );
|
||||
function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) {
|
||||
$crons = _get_cron_array();
|
||||
$schedules = wp_get_schedules();
|
||||
$key = md5(serialize($args));
|
||||
|
@ -21,8 +19,7 @@ function wp_schedule_event( $timestamp, $recurrence, $hook ) {
|
|||
_set_cron_array( $crons );
|
||||
}
|
||||
|
||||
function wp_reschedule_event( $timestamp, $recurrence, $hook ) {
|
||||
$args = array_slice( func_get_args(), 3 );
|
||||
function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array()) {
|
||||
$crons = _get_cron_array();
|
||||
$schedules = wp_get_schedules();
|
||||
$key = md5(serialize($args));
|
||||
|
|
|
@ -698,7 +698,7 @@ function wp_insert_post($postarr = array()) {
|
|||
|
||||
// Schedule publication.
|
||||
if ( 'future' == $post_status )
|
||||
wp_schedule_single_event(strtotime($post_date_gmt. ' GMT'), 'publish_future_post', $post_ID);
|
||||
wp_schedule_single_event(strtotime($post_date_gmt. ' GMT'), 'publish_future_post', array($post_ID));
|
||||
|
||||
do_action('save_post', $post_ID);
|
||||
do_action('wp_insert_post', $post_ID);
|
||||
|
|
Loading…
Reference in New Issue