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:
Scott Taylor 2014-01-29 05:17:12 +00:00
parent 0347a8944e
commit ad211ca06a
1 changed files with 1 additions and 1 deletions

View File

@ -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) )