[wp-trac] [WordPress Trac] #18703: 'pre_get_posts'-filter without effect when modifying 'tax_query'. Wrong parameters passed to 'parse_tax_query() ??; WP 3.2.1.

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 19 13:10:12 UTC 2011


#18703: 'pre_get_posts'-filter without effect when modifying 'tax_query'. Wrong
parameters passed to 'parse_tax_query() ??; WP 3.2.1.
--------------------------+---------------------------------
 Reporter:  xitromedia    |      Owner:  info@…
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.2.1
 Severity:  normal        |   Keywords:
--------------------------+---------------------------------
 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18703>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list