[wp-trac] [WordPress Trac] #65287: block_core_navigation_submenu_render_submenu_icon() removed without deprecation, causing fatal errors on sites using the function
WordPress Trac
noreply at wordpress.org
Thu May 21 00:08:38 UTC 2026
#65287: block_core_navigation_submenu_render_submenu_icon() removed without
deprecation, causing fatal errors on sites using the function
--------------------------------------+---------------------
Reporter: ecairol | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 7.0.1
Component: Editor | Version: 7.0
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+---------------------
Changes (by sabernhardt):
* component: Menus => Editor
* milestone: Awaiting Review => 7.0.1
Old description:
> Version: Gutenberg 23.x / WP 7.0
>
> **Description**
>
> `block_core_navigation_submenu_render_submenu_icon()` was silently
> removed
> in Gutenberg PR #74853 (synced to Core via wordpress-develop PR #10865)
> as
> part of a refactor that consolidated submenu icon rendering into a new
> shared
> function: `block_core_shared_navigation_render_submenu_icon()`.
>
> The old was deleted with no
> `_deprecated_function()`. Since no backwards-compatible alias
> was provided, this is a breaking change for any theme or plugin that
> previously called the function directly.
>
> **Steps to Reproduce**
>
> 1. Install or activate a custom theme (or plugin) that calls
> `block_core_navigation_submenu_render_submenu_icon()` as part of a
> `render_block_core/navigation-submenu` filter (a documented and
> reasonable usage pattern for customizing the dropdown chevron icon).
> 2. Update to Gutenberg 23.x (or WordPress 7.0 with the synced change).
> 3. Load any page on the site.
>
> **Expected Behavior**
>
> - The function call either continues to work, OR
> - WordPress triggers a `_deprecated_function()` notice with guidance to
> use `block_core_shared_navigation_render_submenu_icon()` instead, while
> remaining functional until a future major version.
>
> **Actual Behavior**
>
> A fatal PHP error is thrown.
>
> **Proposed Fix**
>
> Add a deprecated shim in Core.
>
> In `wp-includes/blocks/navigation-submenu.php` (or wherever the function
> previously lived), add a backwards-compatible wrapper:
>
> {{{#!php
> <?php
> /**
> * Renders the submenu icon SVG for the Navigation Submenu block.
> *
> * @deprecated Use block_core_shared_navigation_render_submenu_icon()
> instead.
> * @return string SVG markup for the submenu icon.
> */
> function block_core_navigation_submenu_render_submenu_icon() {
> _deprecated_function(
> __FUNCTION__,
> '7.0.0',
> 'block_core_shared_navigation_render_submenu_icon()'
> );
> return block_core_shared_navigation_render_submenu_icon();
> }
> }}}
>
> **References**
> Gutenberg PR (introduced change):
> https://github.com/WordPress/gutenberg/pull/74853
> WP Core sync PR: https://github.com/WordPress/wordpress-
> develop/pull/10865
New description:
Version: Gutenberg 23.x / WP 7.0
**Description**
`block_core_navigation_submenu_render_submenu_icon()` was silently removed
in
[https://github.com/WordPress/gutenberg/pull/74853 Gutenberg PR #74853]
(synced to Core via [https://github.com/WordPress/wordpress-
develop/pull/10865 wordpress-develop PR #10865] in [61605])
as part of a refactor that consolidated submenu icon rendering into a new
shared
function: `block_core_shared_navigation_render_submenu_icon()`.
The old was deleted with no
`_deprecated_function()`. Since no backwards-compatible alias
was provided, this is a breaking change for any theme or plugin that
previously called the function directly.
**Steps to Reproduce**
1. Install or activate a custom theme (or plugin) that calls
`block_core_navigation_submenu_render_submenu_icon()` as part of a
`render_block_core/navigation-submenu` filter (a documented and
reasonable usage pattern for customizing the dropdown chevron icon).
2. Update to Gutenberg 23.x (or WordPress 7.0 with the synced change).
3. Load any page on the site.
**Expected Behavior**
- The function call either continues to work, OR
- WordPress triggers a `_deprecated_function()` notice with guidance to
use `block_core_shared_navigation_render_submenu_icon()` instead, while
remaining functional until a future major version.
**Actual Behavior**
A fatal PHP error is thrown.
**Proposed Fix**
Add a deprecated shim in Core.
In `wp-includes/blocks/navigation-submenu.php` (or wherever the function
previously lived), add a backwards-compatible wrapper:
{{{#!php
<?php
/**
* Renders the submenu icon SVG for the Navigation Submenu block.
*
* @deprecated Use block_core_shared_navigation_render_submenu_icon()
instead.
* @return string SVG markup for the submenu icon.
*/
function block_core_navigation_submenu_render_submenu_icon() {
_deprecated_function(
__FUNCTION__,
'7.0.0',
'block_core_shared_navigation_render_submenu_icon()'
);
return block_core_shared_navigation_render_submenu_icon();
}
}}}
**References**
Gutenberg PR (introduced change):
https://github.com/WordPress/gutenberg/pull/74853
WP Core sync PR: https://github.com/WordPress/wordpress-develop/pull/10865
--
--
Ticket URL: <https://core.trac.wordpress.org/ticket/65287#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list