mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 16:21:26 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@53370 git-svn-id: http://core.svn.wordpress.org/trunk@52959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a5e2970995
commit
ad517e9c12
@ -2754,8 +2754,6 @@ class WP_Query {
|
||||
}
|
||||
}
|
||||
|
||||
$clauses = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
|
||||
|
||||
/*
|
||||
* Apply post-paging filters on where and join. Only plugins that
|
||||
* manipulate paging queries should use these hooks.
|
||||
@ -2835,6 +2833,8 @@ class WP_Query {
|
||||
*/
|
||||
$fields = apply_filters_ref_array( 'posts_fields', array( $fields, &$this ) );
|
||||
|
||||
$clauses = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
|
||||
|
||||
/**
|
||||
* Filters all query clauses at once, for convenience.
|
||||
*
|
||||
@ -2967,6 +2967,8 @@ class WP_Query {
|
||||
*/
|
||||
$limits = apply_filters_ref_array( 'post_limits_request', array( $limits, &$this ) );
|
||||
|
||||
$clauses = array( 'where', 'groupby', 'join', 'orderby', 'distinct', 'fields', 'limits' );
|
||||
|
||||
/**
|
||||
* Filters all query clauses at once, for convenience.
|
||||
*
|
||||
@ -2990,7 +2992,7 @@ class WP_Query {
|
||||
* }
|
||||
* @param WP_Query $query The WP_Query instance (passed by reference).
|
||||
*/
|
||||
$clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( $clauses, &$this ) );
|
||||
$clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $clauses ), &$this ) );
|
||||
|
||||
$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
|
||||
$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.1-alpha-53368';
|
||||
$wp_version = '6.1-alpha-53370';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user