get_page_of_comment returns wrong page if comments are ordered with newest first
|Reported by:||pajtai||Owned by:||rachelbaker|
Set newest to be at top of comments.
Now the newest comments should be on page 1, but the last page is still returned, becuase the sql statement counts the number of older comments still, since the less than sign is hard coded:
// The following should have the less than sign be greater than if newest comments are shown first: $oldercoms = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = 0 AND comment_approved = '1' AND comment_date_gmt < '%s'" . $comtypewhere, $comment->comment_post_ID, $comment->comment_date_gmt ) );
Change History (14)
7 months ago
- Keywords needs-testing added; dev-feedback removed
- Milestone changed from Awaiting Review to 4.7
Note: See TracTickets for help on using tickets.