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-comment-query.php

    r53299 r53376  
    918918        $where = implode( ' AND ', $this->sql_clauses['where'] );
    919919
    920         $clauses = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
     920        $pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
    921921
    922922        /**
     
    928928         * @param WP_Comment_Query $query   Current instance of WP_Comment_Query (passed by reference).
    929929         */
    930         $clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $clauses ), &$this ) );
     930        $clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
    931931
    932932        $fields  = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
Note: See TracChangeset for help on using the changeset viewer.