[wp-trac] [WordPress Trac] #44872: wp_list_categories: term name of 0 not output

WordPress Trac noreply at wordpress.org
Thu Aug 30 20:28:17 UTC 2018


#44872: wp_list_categories: term name of 0 not output
--------------------------+-----------------------------
 Reporter:  joyously      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Using a term name of '0' is probably a bad idea, but when it is legacy
 data, that's what you do.

 I have a taxonomy called Ratings, with term names of 0, 0.5, 1, 1.5, etc.
 up to 5. The slugs have the word 'star' in them, like '0-star' and
 '3-star'.

 When using `wp_list_categories()` to show them all, the one with '0' is
 not output. Other methods of showing them, such as the menu admin page,
 the taxonomy admin page, and the tag cloud widget all show the '0' term.
 If I use the Edit term page, and change the '0' to '0-', it is then output
 with `wp_list_categories()`.

 Somewhere in the function, `empty()` is causing a problem.

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


More information about the wp-trac mailing list