WordPress.org

Make WordPress Core

Ticket #9285: 9285_postdate.2.diff

File 9285_postdate.2.diff, 865 bytes (added by hailin, 11 years ago)

revised patch

  • C:/xampp/htdocs/wordpress_trunk/wp-includes/post.php

     
    32053205 * @param object $post Object type containing the post information
    32063206 */
    32073207function _future_post_hook($deprecated = '', $post) {
     3208       
    32083209        wp_clear_scheduled_hook( 'publish_future_post', $post->ID );
    3209         wp_schedule_single_event(strtotime($post->post_date_gmt. ' GMT'), 'publish_future_post', array($post->ID));
     3210       
     3211        //safer to derive gmt time from post_date, since this is the user perceived time
     3212        $gmt_tm  = strtotime( $post->post_date ) - get_option( 'gmt_offset' ) * 3600;
     3213       
     3214        wp_schedule_single_event( $gmt_tm, 'publish_future_post', array($post->ID));
    32103215}
    32113216
    32123217/**