Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#42847 new defect (bug)

Twenty Seventeen: Social Menu creates code bloat

Reported by: madriverweb's profile madriverweb Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8.3
Component: Bundled Theme Keywords:
Focuses: Cc:


Theme: Twenty Seventeen
Version: current

The theme has an option to make a social menu.

The Bug
When using the social menu, 150+ lines of code (svg defs) are rendered in source code just above the closing body tag. This code is bloated with all the icons not selected, i.e. about 146 lines not needed when only two icons used.

Steps to replicate:
Add one or more custom links (Facebook) to social menu. Then look at rendered source code.

Change History (2)

#1 @afercia
5 years ago

  • Component changed from General to Bundled Theme

#2 @iCaleb
5 years ago

Looked into this a bit, and seems the SVG defs are always loaded, not only when a social menu is being used. This is because the svg icons are used for more than just social, a couple of examples are the search widget submit button and the left/right archive page arrows.

Reading up on <defs> a bit, this might not really be an issue.

Objects created inside a <defs> element are not rendered immediately; instead, think of them as templates or macros created for future use.


Note: See TracTickets for help on using tickets.