Opened 9 years ago
Closed 9 years ago
#38839 closed defect (bug) (fixed)
wp_list_categories can output not well nested HTML
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
Hi,
#33460 requested an option to hide title if no categories are present. This has been implemented in [33764] and [33767].
However, [33764] introduced a bug that can result in not well nested output, because only the condition that optionally "opens" list item and starts new list has been altered, not the condition that optionally close both.
On a clean install (from trunk):
wp_list_categories([
'child_of' => 1, // to have $categories empty
'hide_title_if_empty' => true, // to hide title
'show_option_none' => '', // to get only the invalid output
]);
Produces:
</ul></li>
I believe, the fix is quite straight-forward - see the patch attached.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Proposed patch for #38839