-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3 gutenberg_-functions called in wp-trunk (blocks/navigation.php) #36962
Comments
These functions were recently removed from Core (WordPress/wordpress-develop@a9e66f4) but remain in the plugin (https://github.com/WordPress/gutenberg/blob/trunk/lib/navigation.php). Are they still being used by the Navigation block? If not, we can simply remove this code. Otherwise, I'm not sure what to do. Ordinarily we would gate functionality that needs to exist in the plugin but not in Core behind the What do you think @talldan? |
#36604 removes those functions from Gutenberg. It's approved, but has been sitting there for a few days and has a bunch of conflicts. From the convo there was uncertainty about whether this should go into 5.9, but given it removes functionality that shouldn't be in core, backporting it would fix the issue here. |
These were already removed for the navigation block in the plugin in #36336. |
Ok, @noisysocks has corrected me, and it's not so much that the functions exist, but that they are called. |
Yeah, but they shouldn't be deleted, they're in use in the plugin. Functions in that file will be renamed when copied to trunk. The issue is that the block's php file is copied automatically and so the call site of those functions is wrong. |
So for some more background, these functions are for the They were also used by navigation area block, but the navigation area feature has been or will be removed. So I think the quandry is how do we handle unstable code given the block php is automatically copied across to core. Now that they're only used by the navigation block I think the following could be possible.
|
This bit isn't strictly necessary. Gating the part of |
True, I'd just prefer to have the function references be correct so that they can be traced to the callsite. |
Description
There are three instances in the navigation block where gutenberg_-functions are called. They should be replaced with their correct function name, and be fixed upstream. Introduced in https://core.trac.wordpress.org/changeset/52069.
File:
/src/wp-includes/blocks/navigation.php
L176:
gutenberg_get_menu_items_at_location
L181:
gutenberg_sort_menu_items_by_parent_id
L182:
gutenberg_parse_blocks_from_menu_items
A ticket for the same issue has been created in the WordPress trac system. https://core.trac.wordpress.org/ticket/54532
Step-by-step reproduction instructions
The functions seems to exist in trunk but under other names, such as
_wp_get_
*Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: