mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 05:31:25 +01:00
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:
parent
c51ce41c59
commit
7387504854
@ -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' ) );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user