Make WordPress Core


Ignore:
Timestamp:
02/12/2006 07:41:56 AM (19 years ago)
Author:
ryan
Message:

Post status = future. #2426

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions-post.php

    r3511 r3514  
    7272            $post_date_gmt = get_gmt_from_date($post_date);
    7373    }
     74
     75    if ( 'publish' == $post_status && (mysql2date('U', $post_date_gmt) > time()) )
     76        $post_status = 'future';
    7477
    7578    if ( empty($comment_status) ) {
     
    204207                add_post_meta($post_ID, '_wp_page_template',  $page_template, true);
    205208    }
     209
     210    if ( 'future' == $post_status )
     211        wp_schedule_event(mysql2date('U', $post_date_gmt), 'once', 'publish_future_post', $post_ID);
    206212
    207213    do_action('save_post', $post_ID);
     
    456462}
    457463
     464function wp_publish_post($post_id) {
     465    $post = get_post($post_id);
     466
     467    if ( empty($post) )
     468        return;
     469
     470    if ( 'publish' == $post->post_status )
     471        return;
     472
     473    return wp_update_post(array('post_status' => 'publish', 'ID' => $post_id));
     474}
     475
    458476function wp_get_post_cats($blogid = '1', $post_ID = 0) {
    459477    global $wpdb;
Note: See TracChangeset for help on using the changeset viewer.