[wp-trac] [WordPress Trac] #11329: Allow _wp_get_comment_list() to return comments only for specific users

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 25 19:44:20 UTC 2011


#11329: Allow _wp_get_comment_list() to return comments only for specific users
-----------------------------------------+--------------------------------
 Reporter:  pampfelimetten               |       Owner:  Denis-de-Bernardy
     Type:  enhancement                  |      Status:  closed
 Priority:  normal                       |   Milestone:  Future Release
Component:  Query                        |     Version:  2.8.5
 Severity:  normal                       |  Resolution:  wontfix
 Keywords:  has-patch 2nd-opinion close  |
-----------------------------------------+--------------------------------
Changes (by pampfelimetten):

 * status:  reviewing => closed
 * resolution:   => wontfix


Comment:

 Should others try to achive the same, with 3.1 it's possible to do it with
 a filter like this:

 {{{
 function cba_get_comment_list_by_user($clauses) {
         if (is_admin()) {
                 global $user_ID, $wpdb;
                 $clauses['join'] = ", cba_posts";
                 $clauses['where'] .= " AND
 ".$wpdb->prefix."posts.post_author = ".$user_ID." AND
 ".$wpdb->prefix."comments.comment_post_ID = ".$wpdb->prefix."posts.ID";
         };
         return $clauses;
 };
 add_filter('comments_clauses', 'cba_get_comment_list_by_user');
 }}}

 Closing the ticket.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11329#comment:24>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list