Changeset 3001
- Timestamp:
- 11/06/2005 07:04:46 AM (19 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r2968 r3001 14 14 15 15 var $is_single = false; 16 var $is_preview = false; 16 17 var $is_page = false; 17 18 var $is_archive = false; … … 535 536 536 537 $now = gmdate('Y-m-d H:i:59'); 537 538 if ($pagenow != 'post.php' && $pagenow != 'edit.php') { 538 539 //only select past-dated posts, except if a logged in user is viewing a single: then, if they 540 //can edit the post, we let them through 541 if ($pagenow != 'post.php' && $pagenow != 'edit.php' && !($this->is_single && $user_ID)) { 539 542 $where .= " AND post_date_gmt <= '$now'"; 540 543 $distinct = 'DISTINCT'; … … 610 613 if ('draft' == $status) { 611 614 // User must have edit permissions on the draft to preview. 612 if (! user_can_edit_post($user_ID, $this->posts[0]->ID)) 615 if (! user_can_edit_post($user_ID, $this->posts[0]->ID)) { 613 616 $this->posts = array(); 617 } else { 618 $this->is_preview = true; 619 } 614 620 } elseif ('private' == $status) { 615 621 if ($this->posts[0]->post_author != $user_ID) 616 622 $this->posts = array(); 623 } 624 } 625 } else { 626 if (mysql2date('U', $this->posts[0]->post_date) > mysql2date('U', $now)) { //it's future dated 627 $this->is_preview = true; 628 if (!current_user_can('edit_post', $this->posts[0]->ID)) { 629 $this->posts = array ( ); 617 630 } 618 631 } -
trunk/wp-includes/functions.php
r2977 r3001 1405 1405 } 1406 1406 1407 function is_preview() { 1408 global $wp_query; 1409 1410 return $wp_query->is_preview; 1411 } 1412 1407 1413 function is_archive () { 1408 1414 global $wp_query;
Note: See TracChangeset
for help on using the changeset viewer.