Changeset 9123

Show
Ignore:
Timestamp:
10/11/08 05:46:20 (2 months ago)
Author:
markjaquith
Message:

Prevent future posts from publishing early. fixes #7441

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/post.php

    r9116 r9123  
    16221622    if ( 'future' != $post->post_status ) 
    16231623        return; 
     1624 
     1625    $time = strtotime( $post->post_date_gmt . ' GMT' ); 
     1626 
     1627    if ( $time > time() ) { // Uh oh, someone jumped the gun! 
     1628        wp_clear_scheduled_hook( 'publish_future_post', $post_id ); // clear anything else in the system 
     1629        wp_schedule_single_event( $time, 'publish_future_post', array( $post_id ) ); 
     1630        return; 
     1631    } 
    16241632 
    16251633    return wp_publish_post($post_id);