Make WordPress Core

Ticket #11329: 11329.003.diff

File 11329.003.diff, 1013 bytes (added by pampfelimetten, 13 years ago)
  • C:/Program

     
    20492049        $post = (int) $post;
    20502050        $count = wp_count_comments();
    20512051        $index = '';
     2052        $userid = apply_filters( 'get_comment_list_by_user', '' );
    20522053
    20532054        if ( 'moderated' == $status ) {
    20542055                $approved = "c.comment_approved = '0'";
     
    20922093                $total = '';
    20932094
    20942095        $query = "FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ";
     2096       
     2097        if ( !empty($userid) ) {
     2098            if(!is_array($userid)) {
     2099                        $query .= "AND p.post_author = '$userid' ";
     2100                } else {
     2101                        $query .= "AND p.post_author IN ('".implode("', '", $userid)."') ";
     2102                }
     2103                $total = '';
     2104        }
     2105       
    20952106        if ( $s ) {
    20962107                $total = '';
    20972108                $s = $wpdb->escape($s);