Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#4501 closed defect (bug) (fixed)

Categories list on post edit screen is not displaying empty categories.

Reported by: cavemonkey50's profile cavemonkey50 Owned by:
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.3
Component: Administration Keywords:
Focuses: Cc:

Description

I've found that get_terms is not outputting terms which have a count of 0 in term_taxonomy. This can be a problem for newly created categories, causing them to be lost in the database if they're not added to a post immediately. Essentially, there is no way to display terms which are not assigned to objects, allowing for numerous orphaned terms in the database.

To recreate:

  • Create a new category on a post
  • Uncheck the category
  • Save the post
  • Category is missing, however database still shows the category, but there is no way to access it

Change History (3)

#1 @ryan
17 years ago

get_terms() defaults to hiding empty terms. If the count is off (#4500), the term won't show. get_terms('taxonomy', 'get=all') will get all terms whether they are empty or not.

#2 @cavemonkey50
17 years ago

  • Severity changed from major to normal
  • Summary changed from get_terms is not displaying terms with a count of 0. to Categories list on post edit screen is not displaying empty categories.

Understood. Then the categories list on the post page needs to display empties, as any newly created categories will not show.

#3 @cavemonkey50
17 years ago

  • Resolution set to fixed
  • Status changed from new to closed

This has been corrected in the latest SVN builds I have downloaded.

Note: See TracTickets for help on using tickets.