Make WordPress Core


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

Post status = future. #2426

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r3511 r3514  
    572572                }
    573573
    574                 $now = gmdate('Y-m-d H:i:59');
     574                //$now = gmdate('Y-m-d H:i:59');
    575575               
    576576                //only select past-dated posts, except if a logged in user is viewing a single: then, if they
    577577                //can edit the post, we let them through
    578                 if ($pagenow != 'post.php' && $pagenow != 'edit.php' && !($this->is_single && $user_ID)) {
    579                         $where .= " AND post_date_gmt <= '$now'";
    580                         $distinct = 'DISTINCT';
    581                 }
     578                //if ($pagenow != 'post.php' && $pagenow != 'edit.php' && !($this->is_single && $user_ID)) {
     579                //      $where .= " AND post_date_gmt <= '$now'";
     580                //      $distinct = 'DISTINCT';
     581                //}
    582582
    583583                if ( $this->is_attachment ) {
    … …  
    590590                        $where .= ' AND (post_type = "post" AND post_status = "publish"';
    591591
    592                         if (isset($user_ID) && ('' != intval($user_ID)))
     592                        if ( $pagenow == 'post.php' || $pagenow == 'edit.php' )
     593                                $where .= " OR post_status = 'future'";
     594                        else
     595                                $distinct = 'DISTINCT';
     596       
     597                        if ( is_user_logged_in() )
    593598                                $where .= " OR post_author = $user_ID AND post_status = 'private')";
    594599                        else
    … …  
    642647                if ($this->is_single || $this->is_page) {
    643648                        $status = get_post_status($this->posts[0]);
     649                        //$type = get_post_type($this->posts[0]);
    644650                        if ( ('publish' != $status) ) {
    645651                                if ( ! is_user_logged_in() ) {
    … …  
    655661                                                        $this->posts[0]->post_date = current_time('mysql');
    656662                                                }
     663                                        }  else if ('future' == $status) {
     664                                                $this->is_preview = true;
     665                                                if (!current_user_can('edit_post', $this->posts[0]->ID)) {
     666                                                        $this->posts = array ( );
     667                                                }
    657668                                        } else {
    658669                                                if (! current_user_can('read_post', $this->posts[0]->ID))
    659670                                                        $this->posts = array();
    660                                         }
    661                                 }
    662                         } else {
    663                                 if (mysql2date('U', $this->posts[0]->post_date_gmt) > mysql2date('U', $now)) { //it's future dated
    664                                         $this->is_preview = true;
    665                                         if (!current_user_can('edit_post', $this->posts[0]->ID)) {
    666                                                 $this->posts = array ( );
    667671                                        }
    668672                                }
Note: See TracChangeset for help on using the changeset viewer.