Opened 15 years ago
Closed 13 years ago
#17778 closed defect (bug) (fixed)
get_comment_pages_count() returns > 1 when pagination is disabled
| Reported by: | dd32 | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.7 |
| Component: | Comments | Version: | 2.7 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Refreshed and tweaked the patch, + updated formatting in the function