-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Rename fse_navigation_area to wp_navigation_area #36460
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
Conversation
getdave
left a comment
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.
Seems reasonable. I haven't had a chance to test this out yet.
I left a couple of comments.
lib/navigation.php
Outdated
| function gutenberg_get_navigation_areas_menus() { | ||
| $areas = get_option( 'wp_navigation_areas', array() ); | ||
| if ( ! $areas ) { | ||
| $areas = get_option( 'fse_navigation_areas', array() ); |
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.
Once fse_navigation_areas has been accessed once should we set the values to wp_navigation_areas and then delete the option fse_navigation_areas? That way we don't have legacy values hanging around on a given install.
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.
It could, but what would it achieve? It's extra complexity that won't lead to removing this if. I wonder if there are any race conditions to consider here, too, when that code path would run concurrently when processing multiple request.
Co-authored-by: Dave Smith <[email protected]>
getdave
left a comment
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
* Rename fse_navigation_area to wp_navigation_area * Update lib/navigation.php Co-authored-by: Dave Smith <[email protected]> * Lint * Rename the remaining function calls to gutenberg_get_navigation_areas_menus Co-authored-by: Dave Smith <[email protected]>
As mentioned in https://github.com/WordPress/wordpress-develop/pull/1865/files#r747291800, the naming convention for options is such that they start with
wp_prefix and not withfse_prefix. This PR renamesfse_navigation_areastowp_navigation_areasby adding a getter function that falls back to the older name. This way the feature keeps working for anyone who had already upgraded to Gutenberg 11.9.