[wp-trac] [WordPress Trac] #17778: get_comment_pages_count() returns > 1 when pagination is disabled

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 13 05:01:59 UTC 2011


#17778: get_comment_pages_count() returns > 1 when pagination is disabled
--------------------------+-----------------------------
 Reporter:  dd32          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Comments      |    Version:  3.2
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 If pagination is disabled, get_comment_pages_count() will still return the
 number of pages possible if pagination was enabled.

 As a workaround, themes & TwentyEleven are having to get to see if
 pagination is enabled first:
 {{{
 <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' )
 ) : // are there comments to navigate through ?>
 }}}

 I'd suggest that if comment pagination is not enabled, this function
 should return 0 or 1 (0 = no comments, 1 = 1 page).

 The addition of an extra block after the
 [http://core.trac.wordpress.org/browser/trunk/wp-includes/comment.php#L740
 empty comments check] would be:
 {{{
 if ( ! get_option('page_comments') )
         return 1;
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17778>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list