Ticket #8592: 8592-post.php.3RC1.diff

File 8592-post.php.3RC1.diff, 1022 bytes (added by sillybean, 3 years ago)

This patch seems to work around the problem in 3.0 RC 1.

  • Users/stephanieleary/Documents/code/WordPress

     
    31743174        if ( $parent >= 0 ) 
    31753175                $where .= $wpdb->prepare(' AND post_parent = %d ', $parent); 
    31763176 
    3177         $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 
     3177        if (current_user_can('read_private_pages') && 'page' == $post_type) 
     3178                $where_post_type = $wpdb->prepare( "post_type = '%s' AND (post_status = '%s' OR post_status = '%s')", $post_type, $post_status, 'private' ); 
     3179        else 
     3180                $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 
    31783181 
    31793182        $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where "; 
    31803183        $query .= $author_query;