mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Allow user_id to be an array of IDs in WP_Comment_Query.
props mordauk. fixes #27064. git-svn-id: https://develop.svn.wordpress.org/trunk@27258 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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' ) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user