Skip to content

Commit

Permalink
Re-differentiate queries
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Sep 11, 2024
1 parent d2928f8 commit d3b5c55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/wp-includes/class-wp-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,12 @@ public function add_rewrite_rules() {
$tag = '([^/]+)';
}

$query = $this->query_var ? "{$this->query_var}=" : "taxonomy=$this->name&term=";

add_rewrite_tag( "%$this->name%", $tag, $query );
add_rewrite_tag( "%$this->name%", $tag, $this->query_var ? "{$this->query_var}=" : "taxonomy=$this->name&term=" );
add_permastruct( $this->name, "{$this->rewrite['slug']}/%$this->name%", $this->rewrite );

add_rewrite_tag( "%$this->name-taxonomy%", "(?:$this->name)", $query );
// For the root taxonomy archive, the query string is simply the query var, with no value set,
// or, if no query var is defined, `taxonomy=$this->name`.
add_rewrite_tag( "%$this->name-taxonomy%", "(?:$this->name)", $this->query_var ? $this->query_var : "taxonomy=$this->name" );
add_permastruct( "$this->name-taxonomy", "%$this->name-taxonomy%", $this->rewrite );
}
}
Expand Down

0 comments on commit d3b5c55

Please sign in to comment.