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.



git-svn-id: https://develop.svn.wordpress.org/trunk@27055 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-01-29 05:16:58 +00:00
parent 1805248438
commit 99ef83d7aa
2 changed files with 171 additions and 1 deletions
+1 -1
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) )