Coding Standards: Remove a one-time $pieces variable in wp-includes/class-wp-*-query.php.

Use the existing `$clauses` variable instead for consistency.

See #54728.

git-svn-id: https://develop.svn.wordpress.org/trunk@52974 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-03-21 12:20:22 +00:00
parent fbf8cb73ec
commit 8182e92220
5 changed files with 20 additions and 19 deletions

View File

@@ -2741,7 +2741,7 @@ class WP_Query {
}
}
$pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
$clauses = compact( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
/*
* Apply post-paging filters on where and join. Only plugins that
@@ -2843,7 +2843,7 @@ class WP_Query {
* }
* @param WP_Query $query The WP_Query instance (passed by reference).
*/
$clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
$clauses = (array) apply_filters_ref_array( 'posts_clauses', array( $clauses, &$this ) );
$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
@@ -2964,7 +2964,7 @@ class WP_Query {
*
* @since 3.1.0
*
* @param string[] $pieces {
* @param string[] $clauses {
* Associative array of the clauses for the query.
*
* @type string $where The WHERE clause of the query.
@@ -2977,7 +2977,7 @@ class WP_Query {
* }
* @param WP_Query $query The WP_Query instance (passed by reference).
*/
$clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
$clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( $clauses, &$this ) );
$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';