Make WordPress Core


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

    r53309 r53376  
    701701        $where = implode( ' AND ', $this->sql_clauses['where'] );
    702702
    703         $clauses = array( 'fields', 'join', 'where', 'distinct', 'orderby', 'order', 'limits' );
     703        $pieces = array( 'fields', 'join', 'where', 'distinct', 'orderby', 'order', 'limits' );
    704704
    705705        /**
     
    722722         * @param array    $args       An array of term query arguments.
    723723         */
    724         $clauses = apply_filters( 'terms_clauses', compact( $clauses ), $taxonomies, $args );
     724        $clauses = apply_filters( 'terms_clauses', compact( $pieces ), $taxonomies, $args );
    725725
    726726        $fields   = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
Note: See TracChangeset for help on using the changeset viewer.