WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9 closed enhancement (fixed)

wp_list_cats() always shows children categories

Reported by: skippy Owned by: JasonV
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:

Description

Documentation for wp_list_cats() in the wiki states:

children - boolean - TRUE or FALSE;
Whether you want to hide or show the
children of the main categories
(top categories only)

When set to "children=FALSE", the only appearant difference is that children categories are output, they're just not nested in the display.

Change History (8)

comment:2 JasonV10 years ago

As it stands, 'children' determines whether the child categories are displayed hierarchically or not. Perhaps it would be best to rename 'children' to 'hierarchical' and update the documentation.

Should there be a 'children' option? Is it desirable to be able to display only the top-level categories? Seems to me somebody will want to do this at some point.

comment:3 skippy10 years ago

Displaying only top-level categories is _exactly_ what I wanted to do. Then I'll include logic to see if the reader is looking at a specific category. If they are, then that categories' children categories should be displayed nested underneath it.

comment:4 JasonV10 years ago

  • Owner changed from anonymous to JasonV
  • Status changed from new to assigned

comment:5 JasonV10 years ago

children=0 will now stop categories below the top level from being displayed
hierarchical=0 will stop categories from being displayed hierarchically

By default, children will be displayed and the display is hierarchical.

comment:6 JasonV10 years ago

  • Resolution changed from 10 to 20
  • Status changed from assigned to closed

comment:7 skippy10 years ago

Sounds like a good fix. Thanks very much!

Note: See TracTickets for help on using tickets.