Changeset 23436 for trunk/wp-includes/query.php
- Timestamp:
- 02/16/2013 02:08:46 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/query.php
r23416 r23436 1407 1407 } 1408 1408 1409 $array_keys = array( 'category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in',1410 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and' );1409 $array_keys = array( 'category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in', 1410 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'post_parent__in', 'post_parent__not_in' ); 1411 1411 1412 1412 foreach ( $array_keys as $key ) { … … 2168 2168 } 2169 2169 2170 if ( is_numeric( $q['post_parent']) )2170 if ( is_numeric( $q['post_parent'] ) ) { 2171 2171 $where .= $wpdb->prepare( " AND $wpdb->posts.post_parent = %d ", $q['post_parent'] ); 2172 } elseif ( $q['post_parent__in'] ) { 2173 $post_parent__in = implode( ',', array_map( 'absint', $q['post_parent__in'] ) ); 2174 $where .= " AND {$wpdb->posts}.post_parent IN ($post_parent__in)"; 2175 } elseif ( $q['post_parent__not_in'] ) { 2176 $post_parent__not_in = implode( ',', array_map( 'absint', $q['post_parent__not_in'] ) ); 2177 $where .= " AND {$wpdb->posts}.post_parent NOT IN ($post_parent__not_in)"; 2178 } 2172 2179 2173 2180 if ( $q['page_id'] ) { … … 2340 2347 } elseif ( $q['orderby'] == 'post__in' && ! empty( $post__in ) ) { 2341 2348 $orderby = "FIELD( {$wpdb->posts}.ID, $post__in )"; 2349 } elseif ( $q['orderby'] == 'post_parent__in' && ! empty( $post_parent__in ) ) { 2350 $orderby = "FIELD( {$wpdb->posts}.post_parent, $post_parent__in )"; 2342 2351 } else { 2343 2352 // Used to filter values
Note: See TracChangeset
for help on using the changeset viewer.