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.
Built from https://develop.svn.wordpress.org/trunk@35933


git-svn-id: http://core.svn.wordpress.org/trunk@35897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2015-12-14 19:46:46 +00:00
parent b6dbe1cea9
commit 3bc0e35684
2 changed files with 2 additions and 2 deletions

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 ( $wp_rewrite->using_permalinks() ) {
if ( $cpage ) { if ( $cpage ) {
$link = trailingslashit( $link ) . $wp_rewrite->comments_pagination_base . '-' . $cpage; $link = trailingslashit( $link ) . $wp_rewrite->comments_pagination_base . '-' . $cpage;

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.5-alpha-35931'; $wp_version = '4.5-alpha-35933';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.