Add Unit Tests for `get_comment_pages_count()`. Fix a notice caused when `$wp_query->comments` is not set in that function.
Props mdbitz, markjaquith. Fixes #20633. Built from https://develop.svn.wordpress.org/trunk@27055 git-svn-id: http://core.svn.wordpress.org/trunk@26928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0347a8944e
commit
ad211ca06a
|
@ -909,7 +909,7 @@ function get_comment_pages_count( $comments = null, $per_page = null, $threaded
|
|||
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) )
|
||||
if ( ( ! $comments || ! is_array( $comments ) ) && ! empty( $wp_query->comments ) )
|
||||
$comments = $wp_query->comments;
|
||||
|
||||
if ( empty($comments) )
|
||||
|
|
Loading…
Reference in New Issue