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

    r53065 r53175  
    27542754        }
    27552755
    2756         $clauses = compact( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
     2756        $clauses = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
    27572757
    27582758        /*
     
    28562856             * @param WP_Query $query   The WP_Query instance (passed by reference).
    28572857             */
    2858             $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( $clauses, &$this ) );
     2858            $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $clauses ), &$this ) );
    28592859
    28602860            $where    = isset( $clauses['where'] ) ? $clauses['where'] : '';
Note: See TracChangeset for help on using the changeset viewer.