Ticket #13927: 13927.diff
File 13927.diff, 1.4 KB (added by , 15 years ago) |
---|
-
wp-includes/query.php
1226 1226 } 1227 1227 1228 1228 $array_keys = array('category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in', 1229 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and' );1229 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'post_parent__in', 'post_parent__not_in'); 1230 1230 1231 1231 foreach ( $array_keys as $key ) { 1232 1232 if ( !isset($array[$key])) … … 1827 1827 $where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)"; 1828 1828 } 1829 1829 1830 if ( is_numeric( $q['post_parent']) )1830 if ( is_numeric( $q['post_parent'] ) ) { 1831 1831 $where .= $wpdb->prepare( " AND $wpdb->posts.post_parent = %d ", $q['post_parent'] ); 1832 } elseif ( $q['post_parent__in'] ) { 1833 $post_parent__in = implode(',', array_map( 'absint', $q['post_parent__in'] ) ); 1834 $where .= " AND $wpdb->posts.post_parent IN ($post_parent__in)"; 1835 } elseif ( $q['post_parent__not_in'] ) { 1836 $post_parent__not_in = implode(',', array_map( 'absint', $q['post_parent__not_in'] ) ); 1837 $where .= " AND $wpdb->posts.post_parent NOT IN ($post_parent__not_in)"; 1838 } 1832 1839 1833 1840 if ( $q['page_id'] ) { 1834 1841 if ( ('page' != get_option('show_on_front') ) || ( $q['page_id'] != get_option('page_for_posts') ) ) {