mirror of
git://develop.git.wordpress.org/
synced 2025-04-04 20:23:27 +02:00
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:
parent
fbf8cb73ec
commit
8182e92220
@ -917,16 +917,17 @@ class WP_Comment_Query {
|
||||
|
||||
$where = implode( ' AND ', $this->sql_clauses['where'] );
|
||||
|
||||
$pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
|
||||
$clauses = compact( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
|
||||
|
||||
/**
|
||||
* Filters the comment query clauses.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param string[] $pieces An associative array of comment query clauses.
|
||||
* @param WP_Comment_Query $query Current instance of WP_Comment_Query (passed by reference).
|
||||
* @param string[] $clauses An associative array of comment query clauses.
|
||||
* @param WP_Comment_Query $query Current instance of WP_Comment_Query (passed by reference).
|
||||
*/
|
||||
$clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
|
||||
$clauses = apply_filters_ref_array( 'comments_clauses', array( $clauses, &$this ) );
|
||||
|
||||
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
|
||||
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
|
||||
|
@ -438,17 +438,17 @@ class WP_Network_Query {
|
||||
|
||||
$groupby = '';
|
||||
|
||||
$pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
|
||||
$clauses = compact( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
|
||||
|
||||
/**
|
||||
* Filters the network query clauses.
|
||||
*
|
||||
* @since 4.6.0
|
||||
*
|
||||
* @param string[] $pieces An associative array of network query clauses.
|
||||
* @param WP_Network_Query $query Current instance of WP_Network_Query (passed by reference).
|
||||
* @param string[] $clauses An associative array of network query clauses.
|
||||
* @param WP_Network_Query $query Current instance of WP_Network_Query (passed by reference).
|
||||
*/
|
||||
$clauses = apply_filters_ref_array( 'networks_clauses', array( compact( $pieces ), &$this ) );
|
||||
$clauses = apply_filters_ref_array( 'networks_clauses', array( $clauses, &$this ) );
|
||||
|
||||
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
|
||||
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
|
||||
|
@ -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'] : '';
|
||||
|
@ -641,17 +641,17 @@ class WP_Site_Query {
|
||||
|
||||
$where = implode( ' AND ', $this->sql_clauses['where'] );
|
||||
|
||||
$pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
|
||||
$clauses = compact( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
|
||||
|
||||
/**
|
||||
* Filters the site query clauses.
|
||||
*
|
||||
* @since 4.6.0
|
||||
*
|
||||
* @param string[] $pieces An associative array of site query clauses.
|
||||
* @param WP_Site_Query $query Current instance of WP_Site_Query (passed by reference).
|
||||
* @param string[] $clauses An associative array of site query clauses.
|
||||
* @param WP_Site_Query $query Current instance of WP_Site_Query (passed by reference).
|
||||
*/
|
||||
$clauses = apply_filters_ref_array( 'sites_clauses', array( compact( $pieces ), &$this ) );
|
||||
$clauses = apply_filters_ref_array( 'sites_clauses', array( $clauses, &$this ) );
|
||||
|
||||
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
|
||||
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
|
||||
|
@ -692,18 +692,18 @@ class WP_Term_Query {
|
||||
|
||||
$where = implode( ' AND ', $this->sql_clauses['where'] );
|
||||
|
||||
$pieces = compact( 'fields', 'join', 'where', 'distinct', 'orderby', 'order', 'limits' );
|
||||
$clauses = compact( 'fields', 'join', 'where', 'distinct', 'orderby', 'order', 'limits' );
|
||||
|
||||
/**
|
||||
* Filters the terms query SQL clauses.
|
||||
*
|
||||
* @since 3.1.0
|
||||
*
|
||||
* @param string[] $pieces Array of query SQL clauses.
|
||||
* @param string[] $clauses Array of query SQL clauses.
|
||||
* @param string[] $taxonomies An array of taxonomy names.
|
||||
* @param array $args An array of term query arguments.
|
||||
*/
|
||||
$clauses = apply_filters( 'terms_clauses', $pieces, $taxonomies, $args );
|
||||
$clauses = apply_filters( 'terms_clauses', $clauses, $taxonomies, $args );
|
||||
|
||||
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
|
||||
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user