[wp-trac] [WordPress Trac] #30865: $tax_query_defaults is hardcoded with "slug" as the field in the parse_tax_query function

WordPress Trac noreply at wordpress.org
Tue Dec 30 15:06:14 UTC 2014


#30865: $tax_query_defaults is hardcoded with "slug" as the field in the
parse_tax_query function
--------------------------+-----------------------------
 Reporter:  jhned         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 There ought to be a check for if the term is numeric, because then the
 field would be the term_id, not the slug.

 The built-in function wp_dropdown_categories clashes with this if you use
 it with a custom taxonomy. The default option values are  term_ids, not
 slugs.

 So, when submitting data from wp_dropdown_categories with a custom
 taxonomy, you get a tax_query that has a term_id for the term, but it's
 trying to match it against a slug, which results in a 404 page.

 Ticket #30306 will certainly help mitigate this issue, but the root cause
 is that slug is being assumed without checking against the value of the
 term.

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


More information about the wp-trac mailing list