Changeset 3510 for trunk/wp-includes/classes.php
- Timestamp:
- 02/09/2006 10:03:48 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/classes.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/classes.php
r3484 r3510 594 594 595 595 if ( $this->is_attachment ) { 596 $where .= ' AND (post_ status= "attachment")';596 $where .= ' AND (post_type = "attachment")'; 597 597 } elseif ($this->is_page) { 598 $where .= ' AND (post_ status = "static")';598 $where .= ' AND (post_type = "page")'; 599 599 } elseif ($this->is_single) { 600 $where .= ' AND (post_ status != "static")';600 $where .= ' AND (post_type = "post")'; 601 601 } else { 602 $where .= ' AND (post_ status = "publish"';602 $where .= ' AND (post_type = "post" AND post_status = "publish"'; 603 603 604 604 if (isset($user_ID) && ('' != intval($user_ID))) 605 $where .= " OR post_author = $user_ID AND post_status != 'draft' AND post_status != 'static')";605 $where .= " OR post_author = $user_ID AND post_status = 'private')"; 606 606 else 607 607 $where .= ')'; 608 608 } 609 610 if (! $this->is_attachment )611 $where .= ' AND post_status != "attachment"';612 609 613 610 // Apply filters on where and join prior to paging so that any … … 655 652 656 653 // Check post status to determine if post should be displayed. 657 if ($this->is_single ) {654 if ($this->is_single || $this->is_page) { 658 655 $status = get_post_status($this->posts[0]); 659 if ( ('publish' != $status) && ('static' != $status)) {660 if ( ! (isset($user_ID) && ('' != intval($user_ID))) ) {656 if ( ('publish' != $status) ) { 657 if ( ! is_user_logged_in() ) { 661 658 // User must be logged in to view unpublished posts. 662 659 $this->posts = array();
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)