[wp-trac] [WordPress Trac] #56518: Terms with "0" slug do not work

WordPress Trac noreply at wordpress.org
Tue Sep 6 08:33:42 UTC 2022


#56518: Terms with "0" slug do not work
--------------------------+-----------------------------
 Reporter:  serge.k       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  6.0.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 How to reproduce:

 1. Create tag with name "0" and slug "0"
 2. Assign it to a post
 3. Open archive page for the tag, e.g. https://example.com/tag/0/

 You will get "not found" error. Same happens to another taxonomies as
 well, e.g. Post Categories.

 That happens because array_filter() removes the "0" slug from
 $query['terms'] in \WP_Tax_Query::transform_query() method.

 Problem is here:
 https://github.com/WordPress/WordPress/blob/6b1cabaea14273b59645714cb3aa4be00e6c9dbb
 /wp-includes/class-wp-tax-query.php#L609

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


More information about the wp-trac mailing list