Make WordPress Core


Ignore:
Timestamp:
03/21/2022 12:20:22 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r52973 r52974  
    27422742        }
    27432743
    2744         $pieces = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
     2744        $clauses = compact( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
    27452745
    27462746        /*
     
    28442844             * @param WP_Query $query   The WP_Query instance (passed by reference).
    28452845             */
    2846             $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
     2846            $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( $clauses, &$this ) );
    28472847
    28482848            $where    = isset( $clauses['where'] ) ? $clauses['where'] : '';
     
    29652965             * @since 3.1.0
    29662966             *
    2967              * @param string[] $pieces {
     2967             * @param string[] $clauses {
    29682968             *     Associative array of the clauses for the query.
    29692969             *
     
    29782978             * @param WP_Query $query  The WP_Query instance (passed by reference).
    29792979             */
    2980             $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
     2980            $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( $clauses, &$this ) );
    29812981
    29822982            $where    = isset( $clauses['where'] ) ? $clauses['where'] : '';
Note: See TracChangeset for help on using the changeset viewer.