Skip to content

Commit

Permalink
Merge pull request #117 from mseymour/fix-rewrite-when-false
Browse files Browse the repository at this point in the history
Ensure that the taxonomy's rewrite property is not false
  • Loading branch information
torounit authored Oct 10, 2024
2 parents e3d6661 + 314b3d6 commit 5d4353c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CPTP/Module/Permalink.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public function term_link( $termlink, $term, $taxonomy ) {
$termlink = str_replace( $wp_home, $wp_home . '/' . $slug, $termlink );
}

if ( ! $taxonomy->rewrite['hierarchical'] ) {
if ( $taxonomy->rewrite !== false && ! $taxonomy->rewrite['hierarchical'] ) {
$termlink = str_replace( $term->slug . '/', CPTP_Util::get_taxonomy_parents_slug( $term->term_id, $taxonomy->name, '/', true ), $termlink );
}

Expand Down

0 comments on commit 5d4353c

Please sign in to comment.