WordPress.org

Make WordPress Core

Ticket #11590: wp_clear_scheduled_hook.diff

File wp_clear_scheduled_hook.diff, 1.5 KB (added by nacin, 5 years ago)
  • wp-includes/post.php

     
    12511251                clean_post_cache($postid); 
    12521252        } 
    12531253 
    1254         wp_clear_scheduled_hook('publish_future_post', $postid); 
     1254        wp_clear_scheduled_hook('publish_future_post', array( $postid ) ); 
    12551255 
    12561256        do_action('deleted_post', $postid); 
    12571257 
     
    19281928        $time = strtotime( $post->post_date_gmt . ' GMT' ); 
    19291929 
    19301930        if ( $time > time() ) { // Uh oh, someone jumped the gun! 
    1931                 wp_clear_scheduled_hook( 'publish_future_post', $post_id ); // clear anything else in the system 
     1931                wp_clear_scheduled_hook( 'publish_future_post', array( $post_id ) ); // clear anything else in the system 
    19321932                wp_schedule_single_event( $time, 'publish_future_post', array( $post_id ) ); 
    19331933                return; 
    19341934        } 
     
    35243524        } 
    35253525 
    35263526        // Always clears the hook in case the post status bounced from future to draft. 
    3527         wp_clear_scheduled_hook('publish_future_post', $post->ID); 
     3527        wp_clear_scheduled_hook('publish_future_post', array( $post->ID ) ); 
    35283528} 
    35293529 
    35303530/** 
     
    35393539 * @param object $post Object type containing the post information 
    35403540 */ 
    35413541function _future_post_hook($deprecated = '', $post) { 
    3542         wp_clear_scheduled_hook( 'publish_future_post', $post->ID ); 
     3542        wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) ); 
    35433543        wp_schedule_single_event(strtotime($post->post_date_gmt. ' GMT'), 'publish_future_post', array($post->ID)); 
    35443544} 
    35453545