In `get_next_comments_link()`, ensure proper pagination when no 'cpage' query var is found.
The 'cpage' query var is only set when using `comments_template()` to display comments. If displaying them in a context where 'cpage' is not yet set, the default value should be 1, not 0. Props MomDad, couturefreak. Fixes #20319. Built from https://develop.svn.wordpress.org/trunk@31617 git-svn-id: http://core.svn.wordpress.org/trunk@31598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7ba0674183
commit
34715e3b1a
|
@ -2466,6 +2466,10 @@ function get_next_comments_link( $label = '', $max_page = 0 ) {
|
||||||
|
|
||||||
$page = get_query_var('cpage');
|
$page = get_query_var('cpage');
|
||||||
|
|
||||||
|
if ( ! $page ) {
|
||||||
|
$page = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$nextpage = intval($page) + 1;
|
$nextpage = intval($page) + 1;
|
||||||
|
|
||||||
if ( empty($max_page) )
|
if ( empty($max_page) )
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.2-alpha-31616';
|
$wp_version = '4.2-alpha-31617';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
|
Loading…
Reference in New Issue