Skip to content

Commit 4ba7f0e

Browse files
committed
Changed topic permastruct to use _bbp_topic_slug option instead of bbp_get_topic_slug()
This ensures that the /forums prefix is not added to the url twice if the prefix is enabled for all content types
1 parent a03633e commit 4ba7f0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Bonnier/WP/BBPress/BetterPermalinks/Permalinks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static function add_post_types_rewrite($postType, $args)
4747
'index.php?forumnames=$matches[1]&name=$matches[2]&post_type='.$postType,
4848
'top'
4949
);
50-
add_permastruct($postType, bbp_get_forum_slug()."%forumnames%".bbp_get_topic_slug()."/%postname%/", $args->rewrite);
50+
add_permastruct($postType, bbp_get_forum_slug()."%forumnames%".get_option( '_bbp_topic_slug', 'topic' )."/%postname%/", $args->rewrite);
5151
static::flush_rewrite_rules_if_needed();
5252
break;
5353
}

0 commit comments

Comments
 (0)