Make WordPress Core


Ignore:
Timestamp:
04/14/2022 12:02:31 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Query: Restore late compact() call for SQL clauses in wp-includes/class-wp-*-query.php.

This addresses a backward compatibility break where posts_groupby and other filters were applied, but their results were subsequently discarded and earlier values were used instead.

Follow-up to [52974].

Props nextend_ramona.
See #54728, #meta6273.

File:
1 edited

Legend:

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

    r53107 r53175  
    647647        $where = implode( ' AND ', $this->sql_clauses['where'] );
    648648
    649         $clauses = compact( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
     649        $clauses = 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( $clauses, &$this ) );
     659        $clauses = apply_filters_ref_array( 'sites_clauses', array( compact( $clauses ), &$this ) );
    660660
    661661        $fields  = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
Note: See TracChangeset for help on using the changeset viewer.