From d554c850ac73826bd1b86fab13d0ff92e07dca54 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 29 Dec 2010 15:58:46 +0000 Subject: [PATCH] Hard limit to 10 comments on edit post screen. Props greuben. fixes #15998 git-svn-id: https://develop.svn.wordpress.org/trunk@17168 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/class-wp-comments-list-table.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-comments-list-table.php b/wp-admin/includes/class-wp-comments-list-table.php index 16b5106deb..67b43c243a 100644 --- a/wp-admin/includes/class-wp-comments-list-table.php +++ b/wp-admin/includes/class-wp-comments-list-table.php @@ -54,8 +54,7 @@ class WP_Comments_List_Table extends WP_List_Table { $orderby = ( isset( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : ''; $order = ( isset( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : ''; - $comments_per_page = $this->get_items_per_page( 'edit_comments_per_page' ); - $comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status ); + $comments_per_page = $this->get_per_page( $comment_status ); $doing_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX; @@ -116,6 +115,12 @@ class WP_Comments_List_Table extends WP_List_Table { 'per_page' => $comments_per_page, ) ); } + + function get_per_page( $comment_status = 'all' ) { + $comments_per_page = $this->get_items_per_page( 'edit_comments_per_page' ); + $comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status ); + return $comments_per_page; + } function no_items() { global $comment_status; @@ -536,6 +541,10 @@ class WP_Post_Comments_List_Table extends WP_Comments_List_Table {