WordPress.org

Make WordPress Core

Ticket #25372: query.diff

File query.diff, 848 bytes (added by layotte, 7 years ago)

Fixed new bug from previous patch

  • wp-includes/query.php

     
    27572757
    27582758                       if ( is_user_logged_in() ) {
    27592759                               // Add private states that are limited to viewing by the author of a post or someone who has caps to read private states.
     2760                               $user_id = get_current_user_id();
    27602761                               $private_states = get_post_stati( array('private' => true) );
    27612762                               foreach ( (array) $private_states as $state )
    27622763                                       $where .= current_user_can( $read_private_cap ) ? " OR $wpdb->posts.post_status = '$state'" : " OR $wpdb->posts.post_author = $user_id AND $wpdb->posts.post_status = '$state'";