Skip to content

Commit

Permalink
1:1 with upstream patch 10up#2241
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahum committed Aug 3, 2021
1 parent 295e678 commit ec59f49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/classes/Indexable/Post/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ public function format_args( $args, $wp_query ) {
*/

// Find root level taxonomies.
if ( empty( $args['tax_query'] ) ) { // Remove duplicate queries from Core's backwards compat feature of setting 'category_name', 'cat': https://github.com/WordPress/WordPress/blob/5d99107bf3ab35aa3dda82c6b3903f5717771335/wp-includes/class-wp-query.php#L2193
if ( empty( $args['tax_query'] ) ) {
if ( isset( $args['category_name'] ) && ! empty( $args['category_name'] ) ) {
$args['tax_query'][] = array(
'taxonomy' => 'category',
Expand Down Expand Up @@ -912,7 +912,7 @@ function( $tax_query ) use ( $args ) {
$args['tax_query']
);

} elseif ( empty( $args['tax_query'] ) ) { // Remove duplicate queries from Core's backwards compat feature of setting 'tag_id': https://github.com/WordPress/WordPress/blob/5d99107bf3ab35aa3dda82c6b3903f5717771335/wp-includes/class-wp-query.php#L2193
} elseif ( empty( $args['tax_query'] ) ) {
$args['tax_query'][] = array(
'taxonomy' => 'post_tag',
'terms' => $args['tag_id'],
Expand Down

0 comments on commit ec59f49

Please sign in to comment.