Commit 0955a2a2 authored by Andrew Nacin's avatar Andrew Nacin
Browse files

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: https://core.svn.wordpress.org/trunk@27115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
parent 839ceb98
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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' ) );