Allow user_id to be an array of IDs in WP_Comment_Query.

props mordauk.
fixes #27064.

Built from https://develop.svn.wordpress.org/trunk@27258


git-svn-id: http://core.svn.wordpress.org/trunk@27115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-02-25 16:35:13 +00:00
parent c51ce41c59
commit 7387504854

View File

@ -373,8 +373,13 @@ class WP_Comment_Query {
}
if ( '' !== $parent )
$where .= $wpdb->prepare( ' AND comment_parent = %d', $parent );
if ( '' !== $user_id )
if ( is_array( $user_id ) ) {
$where .= ' AND user_id IN (' . implode( ',', array_map( 'absint', $user_id ) ) . ')';
} elseif ( '' !== $user_id ) {
$where .= $wpdb->prepare( ' AND user_id = %d', $user_id );
}
if ( '' !== $search )
$where .= $this->get_search_sql( $search, array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' ) );