Make WordPress Core


Ignore:
Timestamp:
05/09/2022 01:49:29 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Query: Restore late compact() call for the posts_clauses_request filter.

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

Follow-up to [52974], [53175].

Props 5um17, johnbillion, SergeyBiryukov.
Fixes #55699.

File:
1 edited

Legend:

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

    r53277 r53370  
    27552755                }
    27562756
    2757                 $clauses = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
    2758 
    27592757                /*
    27602758                 * Apply post-paging filters on where and join. Only plugins that
     
    28352833                         */
    28362834                        $fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) );
     2835
     2836                        $clauses = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
    28372837
    28382838                        /**
     
    29682968                        $limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) );
    29692969
     2970                        $clauses = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
     2971
    29702972                        /**
    29712973                         * Filters all query clauses at once, for convenience.
     
    29912993                         * @param WP_Query $query  The WP_Query instance (passed by reference).
    29922994                         */
    2993                         $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( $clauses, &$this ) );
     2995                        $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $clauses ), &$this ) );
    29942996
    29952997                        $where    = isset( $clauses['where'] ) ? $clauses['where'] : '';
Note: See TracChangeset for help on using the changeset viewer.