| 2261 | | $query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page' AND post_status = 'publish') $where "; |
| 2262 | | $query .= $author_query; |
| | 2261 | $query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page'"; |
| | 2262 | $where .= " AND (post_status = 'publish'"; |
| | 2263 | if ( is_admin() ) |
| | 2264 | $where .= " OR post_status = 'future' OR post_status = 'draft' OR post_status = 'pending'"; |
| | 2265 | if ( is_user_logged_in() ) { |
| | 2266 | $where .= current_user_can( "read_private_pages" ) ? " OR post_status = 'private'" : " OR post_author = $user_ID AND post_status = 'private'"; |
| | 2267 | } |
| | 2268 | $where .= ')'; |
| | 2269 | |
| | 2270 | $query .= " $where )" . $author_query; |