Repository navigation
Description
Replace the regex chevron swap with a registered icon once core routes the submenu chevron through the icon registry.
Low priority / backlog. Not a bug: the current approach works.
Current state
functions.php (origin_canvas_swap_nav_chevron(), around L481–514) swaps WordPress's default navigation submenu chevron for a Lucide chevron. It does this by running preg_replace on the block HTML: it matches core's inline <svg viewBox="0 0 12 12">… and puts an inline Lucide <svg> in its place. It is the theme's only hand-managed inline SVG. No .svg asset files exist; social-links and card-icon-text render through core blocks.
Opportunity
WP 7.1 (Registering and rendering SVG icons) adds a public icon API: wp_register_icon_collection(), wp_register_icon(), wp_get_icon(). The chevron swap could register the Lucide chevron through this API instead of regex-matching core's markup. That is cleaner and does not break if core changes its chevron SVG.
Why it is blocked
Checked against WordPress 7.1 (current stable) and Gutenberg trunk on 2026-09-12. Rechecked on 2026-10-20 against WordPress 7.1.3.
- The Icon API is in 7.1 (
wp-includes/icons.php:wp_register_icon_collection(),wp_register_icon(),wp_get_icon()). But the navigation submenu chevron does not go through it. wp-includes/blocks/navigation-link/shared/render-submenu-icon.phpreturns a hardcoded 12×12 SVG string with no filter.navigation-submenu.phpandnavigation-link.phpcall it directly. Gutenberg trunk is the same.- So on 7.1 the only way to apply a registered icon is still a
preg_replaceon core's output, which the acceptance below rules out. It would also costRequires at least: 7.1for nothing the current swap does not already do. - The API is additive, not a deprecation. Nothing is broken and no migration is required. The theme currently targets 7.0.
The seam this issue needs is Gutenberg PR WordPress/gutenberg#82062 "Resolve SVG through Icon Registry" (opened 2026-08-26; still open with no milestone on 2026-10-20). It routes core block UI icons through the registry and exposes core/navigation-submenu as the identifier a theme overrides by registering a replacement SVG. The PHP render callbacks call wp_get_icon(), and the editor reads the registry through a useIcon() hook. So the override would reach the editor canvas too, which no render_block filter can do today.
Trigger
When #82062 ships in a WordPress release, pick this up. Until then the current swap stays.
Acceptance
- Replace
origin_canvas_swap_nav_chevron()withwp_register_icon( 'core/navigation-submenu', … )carrying the Lucide chevron, in whatever override form the merged PR settles on. - Drop the
preg_replaceon block output. - Bump
Requires at leastinstyle.cssandreadme.txtto the release that ships #82062 (not 7.1, as first planned). - Verify that submenu chevrons still render on the front end and in the editor.
Activity
[-]Modernize nav chevron to the WP 7.1 SVG icon API (wp_register_icon)[/-][+]Modernize the Nav Chevron to the WP 7.1 SVG Icon API[/+]Misplon commentedon Sep 12, 2026
Blocked on core, not on us. Checked against WordPress 7.1 (current stable) and Gutenberg trunk on 2026-09-12.
The Icon API is in 7.1 (
wp-includes/icons.php:wp_register_icon_collection(),wp_register_icon(),wp_get_icon()), but the navigation submenu chevron is not routed through it.wp-includes/blocks/navigation-link/shared/render-submenu-icon.phpreturns the hardcoded 12×12 SVG string with no filter, andnavigation-submenu.phpandnavigation-link.phpcall it directly. Gutenberg trunk is the same. So on 7.1 the only way to apply a registered icon is still apreg_replaceon core's output — which this issue's acceptance rules out — and it would costRequires at least: 7.1for nothing the current swap does not already do.The seam this issue wants is Gutenberg PR WordPress/gutenberg#82062 "Resolve SVG through Icon Registry" (opened 2026-08-26, open): it routes core block UI icons through the registry and exposes
core/navigation-submenuas the identifier a theme overrides by registering a replacement SVG, with the PHP render callbacks callingwp_get_icon()and the editor reading the registry through auseIcon()hook — so the override would reach the editor canvas too, which norender_blockfilter can do today.Trigger: when #82062 ships in a WordPress release, replace
origin_canvas_swap_nav_chevron()with awp_register_icon( 'core/navigation-submenu', … )carrying the Lucide chevron (in whatever override form the merged PR settles on), drop thepreg_replace, and bumpRequires at leastto that release. Until then the current swap stays.[-]Modernize the Nav Chevron to the WP 7.1 SVG Icon API[/-][+]Move the navigation submenu chevron to the core icon registry[/+][-]Move the navigation submenu chevron to the core icon registry[/-][+]Navigation: move the submenu chevron to the core icon registry[/+]