Make WordPress Core


Ignore:
Timestamp:
02/25/2014 04:34:25 PM (12 years ago)
Author:
nacin
Message:

Allow user_id to be an array of IDs in WP_Comment_Query.

props mordauk.
fixes #27064.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment.php

    r27191 r27258  
    374374        if ( '' !== $parent )
    375375            $where .= $wpdb->prepare( ' AND comment_parent = %d', $parent );
    376         if ( '' !== $user_id )
     376
     377        if ( is_array( $user_id ) ) {
     378            $where .= ' AND user_id IN (' . implode( ',', array_map( 'absint', $user_id ) ) . ')';
     379        } elseif ( '' !== $user_id ) {
    377380            $where .= $wpdb->prepare( ' AND user_id = %d', $user_id );
     381        }
     382
    378383        if ( '' !== $search )
    379384            $where .= $this->get_search_sql( $search, array( 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_author_IP', 'comment_content' ) );
Note: See TracChangeset for help on using the changeset viewer.