Make WordPress Core


Ignore:
Timestamp:
12/31/2014 07:37:09 PM (10 years ago)
Author:
boonebgorges
Message:

Support array values for post-related parameters in WP_Comment_Query.

Props nprasath002, c3mdigital, ianmjones.
Fixes #20006.

File:
1 edited

Legend:

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

    r30681 r31015  
    675675            $join_posts_table = true;
    676676            foreach ( $post_fields as $field_name => $field_value ) {
    677                 $where[] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} = %s", $field_value );
     677                // $field_value may be an array.
     678                $esses = array_fill( 0, count( (array) $field_value ), '%s' );
     679                $where[] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} IN (" . implode( ',', $esses ) . ')', $field_value );
    678680            }
    679681        }
Note: See TracChangeset for help on using the changeset viewer.