Rename fse_navigation_area to wp_navigation_area#36460
Merged
noisysocks merged 4 commits intotrunkfrom Nov 15, 2021
Merged
Conversation
getdave
reviewed
Nov 13, 2021
Contributor
getdave
left a comment
There was a problem hiding this comment.
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() ); |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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.
getdave
reviewed
Nov 13, 2021
Co-authored-by: Dave Smith <getdavemail@gmail.com>
getdave
approved these changes
Nov 14, 2021
noisysocks
pushed a commit
that referenced
this pull request
Nov 15, 2021
* Rename fse_navigation_area to wp_navigation_area * Update lib/navigation.php Co-authored-by: Dave Smith <getdavemail@gmail.com> * Lint * Rename the remaining function calls to gutenberg_get_navigation_areas_menus Co-authored-by: Dave Smith <getdavemail@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.