mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 20:54:29 +00:00
Support array values for post-related parameters in WP_Comment_Query.
Props nprasath002, c3mdigital, ianmjones. Fixes #20006. git-svn-id: https://develop.svn.wordpress.org/trunk@31015 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -674,7 +674,9 @@ class WP_Comment_Query {
|
||||
if ( ! empty( $post_fields ) ) {
|
||||
$join_posts_table = true;
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user