Ticket #8592: 8592-post.php.4.diff
File 8592-post.php.4.diff, 837 bytes (added by , 12 years ago) |
---|
-
wp-includes/post.php
3405 3405 if ( $parent >= 0 ) 3406 3406 $where .= $wpdb->prepare(' AND post_parent = %d ', $parent); 3407 3407 3408 $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 3408 if ( current_user_can('read_private_pages') && 'page' == $post_type ) 3409 $where_post_type = $wpdb->prepare( "post_type = '%s' AND (post_status = '%s' OR post_status = 'private')", $post_type, $post_status ); 3410 else 3411 $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 3409 3412 3410 3413 $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where "; 3411 3414 $query .= $author_query;