'pre_get_posts'-filter without effect when modifying 'tax_query'. Wrong parameters passed to 'parse_tax_query() ??; WP 3.2.1.
|Reported by:||xitromedia||Owned by:||info@…|
When modifying the 'tax_query' array directly with 'pre_get_posts' filter (e.g. setting 'include_children' to false), then it will firstly be modified in 'wp-includes/query.php' -> get_posts() after running the filter in line 1911.
But after line 2195 and running 'parse_tax_query' the 'tax_query' 'include_children'-parameter is unwanted reset/changed to the default value.
I think the bug is the following:
parse_tax_query() uses and needs values from the 'tax_query'-array but gets passed over only the 'query_vars'-array. so it resets the 'tax_query'-array-parameters in query.php line 1678 and hereby also the previously and individually set 'tax_query' values.
as far as i understand the core, i assume that any changes to the 'tax_query'-array with 'pre_get_posts'-filter will get lost and only changes to the 'query_vars'-array will take effect.
Change History (16)
4 years ago
- Component changed from General to Query
- Keywords reporter-feedback removed
- Keywords has-patch added; needs-patch removed
- Milestone changed from Awaiting Review to 3.7