From 33de612b0649a41b484deae55044934821f08e2d Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 20 May 2009 22:24:37 +0000 Subject: [PATCH] Fix comment paging for static front page. Props DD32. fixes #8598 git-svn-id: https://develop.svn.wordpress.org/trunk@11419 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/rewrite.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index f0b045475a..12af4059ef 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -1347,6 +1347,12 @@ class WP_Rewrite { $commentmatch = $match . $commentregex; $commentquery = $index . '?' . $query . '&cpage=' . $this->preg_index($num_toks + 1); + if ( get_option('page_on_front') ) { + //create query for Root /comment-page-xx + $rootcommentmatch = $match . $commentregex; + $rootcommentquery = $index . '?' . $query . '&page_id=' . get_option('page_on_front') . '&cpage=' . $this->preg_index($num_toks + 1); + } + //create query for /feed/(feed|atom|rss|rss2|rdf) $feedmatch = $match . $feedregex; $feedquery = $feedindex . '?' . $query . '&feed=' . $this->preg_index($num_toks + 1); @@ -1371,6 +1377,8 @@ class WP_Rewrite { //only on pages with comments add ../comment-page-xx/ if ( EP_PAGES & $ep_mask || EP_PERMALINK & $ep_mask || EP_NONE & $ep_mask ) $rewrite = array_merge($rewrite, array($commentmatch => $commentquery)); + else if ( EP_ROOT & $ep_mask && get_option('page_on_front') ) + $rewrite = array_merge($rewrite, array($rootcommentmatch => $rootcommentquery)); //do endpoints if ($endpoints) {