Make WordPress Core


Ignore:
Timestamp:
04/14/2022 12:02:31 AM (3 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-network-query.php

    r53098 r53175  
    439439        $groupby = '';
    440440
    441         $clauses = compact( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );
     441        $clauses = 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( $clauses, &$this ) );
     451        $clauses = apply_filters_ref_array( 'networks_clauses', array( compact( $clauses ), &$this ) );
    452452
    453453        $fields  = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
Note: See TracChangeset for help on using the changeset viewer.