Omit cpage query var in comment link if comment pagination is disabled.

WP 4.4 changed the way comment pagination is calculated. See #8071. In the
context of `get_comment_link()`, these changes introduced a regression that
causes `cpage` (or its pretty-permalink correlate `comment-page-x`) to appear
in comment links when comment pagination is disabled. The current changeset
fixes the regression.

Fixes #34946.

git-svn-id: https://develop.svn.wordpress.org/trunk@35933 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Boone Gorges
2015-12-14 19:45:45 +00:00
parent 4732139799
commit 42fe7609c7
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -736,7 +736,7 @@ function get_comment_link( $comment = null, $args = array() ) {
}
}
if ( $cpage ) {
if ( $cpage && get_option( 'page_comments' ) ) {
if ( $wp_rewrite->using_permalinks() ) {
if ( $cpage ) {
$link = trailingslashit( $link ) . $wp_rewrite->comments_pagination_base . '-' . $cpage;