Opened 13 years ago
Closed 11 years ago
#17778 closed defect (bug) (fixed)
get_comment_pages_count() returns > 1 when pagination is disabled
Reported by: | dd32 | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | 2.7 |
Component: | Comments | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
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 empty comments check would be:
if ( ! get_option('page_comments') ) return 1;
Attachments (3)
Change History (9)
Note: See
TracTickets for help on using
tickets.
Refreshed and tweaked the patch, + updated formatting in the function