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: https://develop.svn.wordpress.org/trunk@15604 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2010-09-09 20:34:40 +00:00
parent 9d784b7329
commit bb132059a3
1 changed files with 8 additions and 1 deletions

View File

@ -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' ) ) )