Changeset 11392 for trunk/wp-includes/query.php
- Timestamp:
- 05/19/2009 03:25:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r11386 r11392 1583 1583 $groupby = ''; 1584 1584 $fields = "$wpdb->posts.*"; 1585 $post_status_join = false;1586 1585 $page = 1; 1587 1586 … … 1959 1958 $post_type = 'any'; 1960 1959 $q['post_status'] = 'publish'; 1961 $post_status_join = true;1962 1960 } else { 1963 1961 $whichcat = " AND 0 "; … … 2066 2064 2067 2065 if ( 'any' == $post_type ) { 2068 $where .= '';2066 $where .= " AND $wpdb->posts.post_type != 'revision'"; 2069 2067 } elseif ( $this->is_attachment ) { 2070 2068 $where .= " AND $wpdb->posts.post_type = 'attachment'"; … … 2111 2109 else 2112 2110 $statuswheres[] = "(" . join( ' OR ', $p_status ) . ")"; 2113 }2114 if ( $post_status_join ) {2115 $join .= " JOIN $wpdb->posts AS p2 ON ($wpdb->posts.post_parent = p2.ID) ";2116 foreach ( $statuswheres as $index => $statuswhere )2117 $statuswheres[$index] = "($statuswhere OR ($wpdb->posts.post_status = 'inherit' AND " . str_replace($wpdb->posts, 'p2', $statuswhere) . "))";2118 2111 } 2119 2112 foreach ( $statuswheres as $statuswhere )
Note: See TracChangeset
for help on using the changeset viewer.