-
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
Navigation: Simplify the method for finding the fallback menu #48916
Conversation
Size Change: -50 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this. Works as advertised.
Left one small request 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
Flaky tests detected in 15372a9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4362887896
|
Thank you! |
What?
A follow-up based on #48908 (comment).
PR simplifies the method for finding the fallback navigation menu ID.
How?
fallbackNavigationMenus
withfallbackNavigationMenuId
.filter
withfind
. The latter stops iterating through the array whencallback
returns a truthy value. A small perf optimiazation.Testing Instructions
Make sure there's at least one published
wp_navigation
menu item. Go to/wp-admin/edit.php?post_type=wp_navigation
Screenshots or screencast
CleanShot.2023-03-08.at.13.05.49.mp4