mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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:
parent
36f36dca77
commit
f1a4fd6e85
@ -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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user