Fix comment paging for static front page. Props DD32. fixes #8598

git-svn-id: http://svn.automattic.com/wordpress/trunk@11419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-05-20 22:24:37 +00:00
parent ccec7e0077
commit 2eafafa8c6
1 changed files with 8 additions and 0 deletions

View File

@ -1347,6 +1347,12 @@ class WP_Rewrite {
$commentmatch = $match . $commentregex; $commentmatch = $match . $commentregex;
$commentquery = $index . '?' . $query . '&cpage=' . $this->preg_index($num_toks + 1); $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) //create query for /feed/(feed|atom|rss|rss2|rdf)
$feedmatch = $match . $feedregex; $feedmatch = $match . $feedregex;
$feedquery = $feedindex . '?' . $query . '&feed=' . $this->preg_index($num_toks + 1); $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/ //only on pages with comments add ../comment-page-xx/
if ( EP_PAGES & $ep_mask || EP_PERMALINK & $ep_mask || EP_NONE & $ep_mask ) if ( EP_PAGES & $ep_mask || EP_PERMALINK & $ep_mask || EP_NONE & $ep_mask )
$rewrite = array_merge($rewrite, array($commentmatch => $commentquery)); $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 //do endpoints
if ($endpoints) { if ($endpoints) {