Make WordPress Core


Ignore:
Timestamp:
10/11/2008 05:46:20 AM (16 years ago)
Author:
markjaquith
Message:

Prevent future posts from publishing early. fixes #7441

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.