From 6ba5cecaaa04878db946c539aa3e885121157bd9 Mon Sep 17 00:00:00 2001 From: westi Date: Thu, 9 Sep 2010 20:34:40 +0000 Subject: [PATCH] Apply some bandaid to WP_Comments_Table::prepare_items() to cover more of the different ways we include post IDs in urls/ajax queries. git-svn-id: http://svn.automattic.com/wordpress/trunk@15604 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/default-list-tables.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/default-list-tables.php b/wp-admin/includes/default-list-tables.php index 14ad60a458..c3a8315cf4 100644 --- a/wp-admin/includes/default-list-tables.php +++ b/wp-admin/includes/default-list-tables.php @@ -2029,7 +2029,14 @@ class WP_Comments_Table extends WP_List_Table { function prepare_items() { global $post_id, $comment_status, $search; - $post_id = isset( $_REQUEST['p'] ) ? absint( $_REQUEST['p'] ) : 0; + if ( isset( $_REQUEST['p'] ) ) + $post_id = absint( $_REQUEST['p'] ); + elseif ( isset( $_REQUEST['post'] ) ) + $post_id = absint( $_REQUEST['post'] ); + elseif ( isset( $_REQUEST['post_ID'] ) ) + $post_id = absint( $_REQUEST['post_ID'] ); + else + $post_id = 0; $comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all'; if ( !in_array( $comment_status, array( 'all', 'moderated', 'approved', 'spam', 'trash' ) ) )