mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 22:57:20 +00:00
Add paging links above comments list. Props Viper007Bond. fixes #8219
git-svn-id: https://develop.svn.wordpress.org/trunk@10097 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -513,6 +513,9 @@ function &separate_comments(&$comments) {
|
||||
function get_comment_pages_count( $comments = null, $per_page = null, $threaded = null ) {
|
||||
global $wp_query;
|
||||
|
||||
if ( null === $comments && null === $per_page && null === $threaded && !empty($wp_query->max_num_comment_pages) )
|
||||
return $wp_query->max_num_comment_pages;
|
||||
|
||||
if ( !$comments || !is_array($comments) )
|
||||
$comments = $wp_query->comments;
|
||||
|
||||
|
||||
@@ -1265,6 +1265,9 @@ function next_comments_link($label='', $max_page = 0) {
|
||||
if ( empty($max_page) )
|
||||
$max_page = $wp_query->max_num_comment_pages;
|
||||
|
||||
if ( empty($max_page) )
|
||||
$max_page = get_comment_pages_count();
|
||||
|
||||
if ( $nextpage > $max_page )
|
||||
return;
|
||||
|
||||
@@ -1324,7 +1327,7 @@ function paginate_comments_links($args = array()) {
|
||||
$page = get_query_var('cpage');
|
||||
if ( !$page )
|
||||
$page = 1;
|
||||
$max_page = $wp_query->max_num_comment_pages;
|
||||
$max_page = get_comment_pages_count();
|
||||
$defaults = array(
|
||||
'base' => add_query_arg( 'cpage', '%#%' ),
|
||||
'format' => '',
|
||||
|
||||
Reference in New Issue
Block a user