[wp-trac] [WordPress Trac] #32454: WP_Query->parse_tax_query() can't handle arrays from URL querystring

WordPress Trac noreply at wordpress.org
Thu May 21 03:15:36 UTC 2015


#32454: WP_Query->parse_tax_query() can't handle arrays from URL querystring
--------------------------+-----------------------------
 Reporter:  Veraxus       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When using querystring variables to filter taxonomies (default WordPress
 behavior) `WP_Query->parse_tax_query()` assumes it's getting a string from
 the URL (`?tax=1,2,3,4`).

 However, if using HTML form-based filtering, such as a checkbox list, an
 array is passed instead. When this happens, not only does the
 search/filter not work, a slew of warnings are generated since
 `WP_Query->parse_tax_query()` is only capable of handling strings.

 Fortunately, this is easily fixed with just three lines. If the array is
 detected and imploded before being handled, everything works as
 expected/designed without generating any errors or warnings.

 Patch file is attached.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32454>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list