Ticket #34525: 34525.diff
File 34525.diff, 2.7 KB (added by , 9 years ago) |
---|
-
wp-includes/query.php
2002 2002 } 2003 2003 2004 2004 if ( ! empty( $q['category__in'] ) ) { 2005 $q['category__in'] = array_map( 'absint', array_unique( (array) $q['category__in'] ));2005 $q['category__in'] = wp_parse_id_list( (array) $q['category__in'] ); 2006 2006 $tax_query[] = array( 2007 2007 'taxonomy' => 'category', 2008 2008 'terms' => $q['category__in'], … … 2012 2012 } 2013 2013 2014 2014 if ( ! empty($q['category__not_in']) ) { 2015 $q['category__not_in'] = array_map( 'absint', array_unique( (array) $q['category__not_in'] ));2015 $q['category__not_in'] = wp_parse_id_list( (array) $q['category__not_in'] ); 2016 2016 $tax_query[] = array( 2017 2017 'taxonomy' => 'category', 2018 2018 'terms' => $q['category__not_in'], … … 2022 2022 } 2023 2023 2024 2024 if ( ! empty($q['category__and']) ) { 2025 $q['category__and'] = array_map( 'absint', array_unique( (array) $q['category__and'] ));2025 $q['category__and'] = wp_parse_id_list( (array) $q['category__and'] ); 2026 2026 $tax_query[] = array( 2027 2027 'taxonomy' => 'category', 2028 2028 'terms' => $q['category__and'], … … 2066 2066 } 2067 2067 2068 2068 if ( !empty($q['tag__in']) ) { 2069 $q['tag__in'] = array_map('absint', array_unique( (array) $q['tag__in'] ));2069 $q['tag__in'] = wp_parse_id_list( (array) $q['tag__in'] ); 2070 2070 $tax_query[] = array( 2071 2071 'taxonomy' => 'post_tag', 2072 2072 'terms' => $q['tag__in'] … … 2074 2074 } 2075 2075 2076 2076 if ( !empty($q['tag__not_in']) ) { 2077 $q['tag__not_in'] = array_map('absint', array_unique( (array) $q['tag__not_in'] ));2077 $q['tag__not_in'] = wp_parse_id_list( (array) $q['tag__not_in'] ); 2078 2078 $tax_query[] = array( 2079 2079 'taxonomy' => 'post_tag', 2080 2080 'terms' => $q['tag__not_in'], … … 2083 2083 } 2084 2084 2085 2085 if ( !empty($q['tag__and']) ) { 2086 $q['tag__and'] = array_map('absint', array_unique( (array) $q['tag__and'] ));2086 $q['tag__and'] = wp_parse_id_list( (array) $q['tag__and'] ); 2087 2087 $tax_query[] = array( 2088 2088 'taxonomy' => 'post_tag', 2089 2089 'terms' => $q['tag__and'], … … 2908 2908 } 2909 2909 2910 2910 if ( ! empty( $q['author__not_in'] ) ) { 2911 $author__not_in = implode( ',', array_map( 'absint', array_unique( (array) $q['author__not_in'] )) );2911 $author__not_in = implode( ',', wp_parse_id_list( (array) $q['author__not_in'] ) ); 2912 2912 $where .= " AND {$wpdb->posts}.post_author NOT IN ($author__not_in) "; 2913 2913 } elseif ( ! empty( $q['author__in'] ) ) { 2914 $author__in = implode( ',', array_map( 'absint', array_unique( (array) $q['author__in'] )) );2914 $author__in = implode( ',', wp_parse_id_list( (array) $q['author__in'] ) ); 2915 2915 $where .= " AND {$wpdb->posts}.post_author IN ($author__in) "; 2916 2916 } 2917 2917