Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Oct 9, 2024
1 parent d8207ea commit 98230d3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/wp-includes/class-wp-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,15 +510,12 @@ public function add_rewrite_rules() {
$tag = '([^/]+)';
}

if ( $this->query_var ) {
add_rewrite_tag( "%taxonomy-$this->name%", "$this->name()", "{$this->query_var}=" );
} else {
add_rewrite_tag( "%taxonomy-$this->name%", "($this->name)", 'taxonomy=' );
}
$query = $this->query_var ? "{$this->query_var}=" : "taxonomy=$this->name&term=";

add_rewrite_tag( "%taxonomy-$this->name%", "$this->name()", $query );
add_permastruct( "taxonomy-$this->name", "%taxonomy-$this->name%", $this->rewrite );

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

0 comments on commit 98230d3

Please sign in to comment.