2242 | | $query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page' AND post_status = 'publish') $where "; |
2243 | | $query .= $author_query; |
| 2242 | $query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page'"; |
| 2243 | $where .= " AND (post_status = 'publish'"; |
| 2244 | if ( is_admin() ) |
| 2245 | $where .= " OR post_status = 'future' OR post_status = 'draft' OR post_status = 'pending'"; |
| 2246 | if ( is_user_logged_in() ) { |
| 2247 | $where .= current_user_can( "read_private_pages" ) ? " OR post_status = 'private'" : " OR post_author = $user_ID AND post_status = 'private'"; |
| 2248 | } |
| 2249 | $where .= ')'; |
| 2250 | |
| 2251 | $query .= " $where )" . $author_query; |