Make WordPress Core


Ignore:
Timestamp:
05/10/2022 11:19:51 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Restore the $pieces variable for SQL clauses in query classes.

This is a defensive coding measure that aims to reduce confusion. With this change, $pieces is explicitly used for the names, and $clauses for the values of the clauses.

Follow-up to [52974], [53175], [53370], [53375].

Props peterwilsoncc.
See #55699.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-site-query.php

    r53274 r53376  
    647647        $where = implode( ' AND ', $this->sql_clauses['where'] );
    648648
    649         $clauses = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
     649        $pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
    650650
    651651        /**
     
    657657         * @param WP_Site_Query $query   Current instance of WP_Site_Query (passed by reference).
    658658         */
    659         $clauses = apply_filters_ref_array( 'sites_clauses', array( compact( $clauses ), &$this ) );
     659        $clauses = apply_filters_ref_array( 'sites_clauses', array( compact( $pieces ), &$this ) );
    660660
    661661        $fields  = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
Note: See TracChangeset for help on using the changeset viewer.