Make WordPress Core


Ignore:
Timestamp:
05/10/2022 11:19:51 AM (4 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-network-query.php

    r53273 r53376  
    439439                $groupby = '';
    440440
    441                 $clauses = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
     441                $pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
    442442
    443443                /**
     
    449449                 * @param WP_Network_Query $query   Current instance of WP_Network_Query (passed by reference).
    450450                 */
    451                 $clauses = apply_filters_ref_array( 'networks_clauses', array( compact( $clauses ), &$this ) );
     451                $clauses = apply_filters_ref_array( 'networks_clauses', array( compact( $pieces ), &$this ) );
    452452
    453453                $fields  = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
Note: See TracChangeset for help on using the changeset viewer.