Query: Restore late compact() call for SQL clauses in wp-includes/class-wp-*-query.php.
This addresses a backward compatibility break where `posts_groupby` and other filters were applied, but their results were subsequently discarded and earlier values were used instead. Follow-up to [52974]. Props nextend_ramona. See #54728, #meta6273. Built from https://develop.svn.wordpress.org/trunk@53175 git-svn-id: http://core.svn.wordpress.org/trunk@52764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -692,7 +692,7 @@ class WP_Term_Query {
|
||||
|
||||
$where = implode( ' AND ', $this->sql_clauses['where'] );
|
||||
|
||||
$clauses = compact( 'fields', 'join', 'where', 'distinct', 'orderby', 'order', 'limits' );
|
||||
$clauses = array( 'fields', 'join', 'where', 'distinct', 'orderby', 'order', 'limits' );
|
||||
|
||||
/**
|
||||
* Filters the terms query SQL clauses.
|
||||
@@ -703,7 +703,7 @@ class WP_Term_Query {
|
||||
* @param string[] $taxonomies An array of taxonomy names.
|
||||
* @param array $args An array of term query arguments.
|
||||
*/
|
||||
$clauses = apply_filters( 'terms_clauses', $clauses, $taxonomies, $args );
|
||||
$clauses = apply_filters( 'terms_clauses', compact( $clauses ), $taxonomies, $args );
|
||||
|
||||
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
|
||||
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
|
||||
|
||||
Reference in New Issue
Block a user