Make WordPress Core

#45301 closed defect (bug) (invalid)

Menu ID is missing from li element when two menu containers have the same menu set

Reported by: BackuPs Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0
Component: Menus Keywords: close
Focuses: Cc:

Description (last modified by SergeyBiryukov)


I think there is a bug. When you have menu and set that same menu to two menu containers the second one does not have the menu id for the li element. It is missing

Tested with wordpress default theme 20-17 and set the same menu to the main menu and the social menu container. When done so the social menu container has no ID field on each li element. It is completely missing

See images attached




How to fix this?

Attachments (3)

menu-set-two-containers.png (55.4 KB) - added by SergeyBiryukov 21 months ago.
menu-li-id-missing.png (47.8 KB) - added by SergeyBiryukov 21 months ago.
main-menu.png (96.1 KB) - added by SergeyBiryukov 21 months ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
21 months ago

  • Description modified (diff)

#2 @SergeyBiryukov
21 months ago

  • Component changed from General to Menus
  • Keywords close added; needs-patch removed

Hi @BackuPs, welcome to WordPress Trac! Thanks for the report.

This is intentional, as duplicate ID attributes is invalid HTML. See the discussion in #13976.

#3 @matveb
20 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.