Skip to content

Commit 9c946e8

Browse files
authored
Merge pull request #2 from BenjaminMedia/bugfix-paged-topics
Added rewrite tag for paged topics
2 parents 4ba7f0e + a7c50c3 commit 9c946e8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,19 @@ public static function add_post_types_rewrite($postType, $args)
4242
{
4343
switch ($postType) {
4444
case bbp_get_topic_post_type():
45+
46+
add_rewrite_rule(
47+
bbp_get_forum_slug().'(.+?)'.bbp_get_topic_slug().'/(.+?)/'.bbp_get_paged_slug().'/([0-9]{1,})/?$',
48+
'index.php?forumnames=$matches[1]&name=$matches[2]&post_type='.$postType.'&paged=$matches[3]',
49+
'top'
50+
);
51+
4552
add_rewrite_rule(
46-
'^'.bbp_get_forum_slug().'(.+?)'.bbp_get_topic_slug().'/(.+?)/?$',
53+
bbp_get_forum_slug().'(.+?)'.bbp_get_topic_slug().'/(.+?)/?$',
4754
'index.php?forumnames=$matches[1]&name=$matches[2]&post_type='.$postType,
4855
'top'
4956
);
57+
5058
add_permastruct($postType, bbp_get_forum_slug()."%forumnames%".get_option( '_bbp_topic_slug', 'topic' )."/%postname%/", $args->rewrite);
5159
static::flush_rewrite_rules_if_needed();
5260
break;

0 commit comments

Comments
 (0)