Make WordPress Core

Changeset 5579


Ignore:
Timestamp:
05/28/2007 08:39:24 PM (17 years ago)
Author:
rob1n
Message:

Add a is_user_logged_in() check.

File:
1 edited

Legend:

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

    r5575 r5579  
    10251025            if ( is_admin() )
    10261026                $where .= " OR post_status = 'future' OR post_status = 'draft'";
    1027 
    1028             $where .= current_user_can( "read_private_{$post_type}s" ) ? " OR post_status = 'private'" : " OR post_author = $user_ID AND post_status = 'private'";
     1027           
     1028            if ( is_user_logged_in() ) {
     1029                $where .= current_user_can( "read_private_{$post_type}s" ) ? " OR post_status = 'private'" : " OR post_author = $user_ID AND post_status = 'private'";
     1030            }
    10291031
    10301032            $where .= ')';
Note: See TracChangeset for help on using the changeset viewer.