Support array values for post-related parameters in WP_Comment_Query.

Props nprasath002, c3mdigital, ianmjones.
Fixes #20006.
Built from https://develop.svn.wordpress.org/trunk@31015


git-svn-id: http://core.svn.wordpress.org/trunk@30996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2014-12-31 19:38:22 +00:00
parent 36f36dca77
commit f1a4fd6e85
2 changed files with 4 additions and 2 deletions

View File

@ -674,7 +674,9 @@ class WP_Comment_Query {
if ( ! empty( $post_fields ) ) { if ( ! empty( $post_fields ) ) {
$join_posts_table = true; $join_posts_table = true;
foreach ( $post_fields as $field_name => $field_value ) { foreach ( $post_fields as $field_name => $field_value ) {
$where[] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} = %s", $field_value ); // $field_value may be an array.
$esses = array_fill( 0, count( (array) $field_value ), '%s' );
$where[] = $wpdb->prepare( " {$wpdb->posts}.{$field_name} IN (" . implode( ',', $esses ) . ')', $field_value );
} }
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.2-alpha-31014'; $wp_version = '4.2-alpha-31015';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.