Opened 2 years ago
Last modified 23 months ago
#17778 new defect (bug)
get_comment_pages_count() returns > 1 when pagination is disabled
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Comments | Version: | 3.2 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | kobenland |
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 (2)
Change History (4)
comment:2
jakub.tyrcha — 23 months ago
- Keywords has-patch added
jakub.tyrcha — 23 months ago
Note: See
TracTickets for help on using
tickets.

Refreshed and tweaked the patch, + updated formatting in the function