WordPress.org

Make WordPress Core

Ticket #11248: comment-template.php.patch.13396.txt

File comment-template.php.patch.13396.txt, 613 bytes (added by edward mindreantre, 5 years ago)
Line 
1Index: wp-includes/comment-template.php
2===================================================================
3--- wp-includes/comment-template.php    (revision 13695)
4+++ wp-includes/comment-template.php    (working copy)
5@@ -1437,6 +1437,11 @@
6                $walker = new Walker_Comment;
7 
8        $walker->paged_walk($_comments, $max_depth, $page, $per_page, $r);
9+       
10+       // Requested a non-existent page? Output the last one.
11+       if ($r['page'] > $walker->max_pages)
12+               $walker->paged_walk($_comments, $max_depth, $walker->max_pages, $per_page, $r);
13+
14        $wp_query->max_num_comment_pages = $walker->max_pages;
15 
16        $in_comment_loop = false;
17