From c7e2071893d409aff5e8aad611ec6365dfdeef2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Fri, 20 Sep 2013 20:16:11 +0000 Subject: [PATCH] Make it possible to filter comment screen by post type; no UI. props johnbillion, c3mdigital. fixes #18596. Built from https://develop.svn.wordpress.org/trunk@25526 git-svn-id: http://core.svn.wordpress.org/trunk@25446 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-comments-list-table.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-admin/includes/class-wp-comments-list-table.php b/wp-admin/includes/class-wp-comments-list-table.php index 23f3169d04..345bda2f5b 100644 --- a/wp-admin/includes/class-wp-comments-list-table.php +++ b/wp-admin/includes/class-wp-comments-list-table.php @@ -52,6 +52,8 @@ class WP_Comments_List_Table extends WP_List_Table { $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : ''; + $post_type = ( isset( $_REQUEST['post_type'] ) ) ? sanitize_key( $_REQUEST['post_type'] ) : ''; + $user_id = ( isset( $_REQUEST['user_id'] ) ) ? $_REQUEST['user_id'] : ''; $orderby = ( isset( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : ''; @@ -96,6 +98,7 @@ class WP_Comments_List_Table extends WP_List_Table { 'type' => $comment_type, 'orderby' => $orderby, 'order' => $order, + 'post_type' => $post_type, ); $_comments = get_comments( $args );