WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#53591 new defect (bug)

Firts <ul> missing in wp_list_categories()

Reported by: sebastienserre Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: needs-patch
Focuses: docs, template Cc:

Description

Hello,

When using the [wp_list_categories()] function it provides an HTML list starting right by an <li> without the <ul>.

Attachments (1)

53591-li-no-ul.png (25.9 KB) - added by sebastienserre 3 months ago.

Download all attachments as: .zip

Change History (5)

#1 @audrasjb
3 months ago

  • Component changed from General to Taxonomy
  • Focuses accessibility template added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 5.9

I can reproduce this issue as well.
And it's even worse: there is no opening <ul> tag but we have a closing </ul> tag :)

Moving for 5.9 consideration.

#2 @ocean90
3 months ago

  • Focuses accessibility removed
  • Milestone changed from 5.9 to Awaiting Review

wp_list_categories() never has output the full list markup. Not sure where you're seeing a closing </ul> tag. Neither does wp_list_pages() and probably other similar functions.

This seems to be more of a lack of documentation issue.

#3 @johnbillion
3 months ago

  • Focuses docs added

I believe this is intentional because it's used within some sidebar widgets that nest the list of categories within another list. Agreed that it needs a docs update.

#4 @sebastienserre
3 months ago

Thank you all for your feedback.

I understand it has been in this situation for a long time, however having a <li> without a <ul> is a syntax problem I think. But i agree, it needs some

Why not adding a default parameter "ul" => false?
That way, current widgets will still be OK and we'll be able to have a correct syntax with this parameter on true.

Note: See TracTickets for help on using tickets.