Changeset 3514 for trunk/wp-includes/classes.php
- Timestamp:
- 02/12/2006 07:41:56 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r3511 r3514 572 572 } 573 573 574 $now = gmdate('Y-m-d H:i:59');574 //$now = gmdate('Y-m-d H:i:59'); 575 575 576 576 //only select past-dated posts, except if a logged in user is viewing a single: then, if they 577 577 //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 //} 582 582 583 583 if ( $this->is_attachment ) { … … 590 590 $where .= ' AND (post_type = "post" AND post_status = "publish"'; 591 591 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() ) 593 598 $where .= " OR post_author = $user_ID AND post_status = 'private')"; 594 599 else … … 642 647 if ($this->is_single || $this->is_page) { 643 648 $status = get_post_status($this->posts[0]); 649 //$type = get_post_type($this->posts[0]); 644 650 if ( ('publish' != $status) ) { 645 651 if ( ! is_user_logged_in() ) { … … 655 661 $this->posts[0]->post_date = current_time('mysql'); 656 662 } 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 } 657 668 } else { 658 669 if (! current_user_can('read_post', $this->posts[0]->ID)) 659 670 $this->posts = array(); 660 }661 }662 } else {663 if (mysql2date('U', $this->posts[0]->post_date_gmt) > mysql2date('U', $now)) { //it's future dated664 $this->is_preview = true;665 if (!current_user_can('edit_post', $this->posts[0]->ID)) {666 $this->posts = array ( );667 671 } 668 672 }
Note: See TracChangeset
for help on using the changeset viewer.