Skip to content

Conversation

@adamziel
Copy link
Contributor

@adamziel adamziel commented Nov 13, 2021

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 with fse_ prefix. This PR renames fse_navigation_areas to wp_navigation_areas by 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.

Copy link
Contributor

@getdave getdave left a 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.

function gutenberg_get_navigation_areas_menus() {
$areas = get_option( 'wp_navigation_areas', array() );
if ( ! $areas ) {
$areas = get_option( 'fse_navigation_areas', array() );
Copy link
Contributor

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.

Copy link
Contributor Author

@adamziel adamziel Nov 13, 2021

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.

adamziel and others added 2 commits November 13, 2021 11:26
Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: Thank you

@adamziel adamziel added the Backport to WP 6.9 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Nov 13, 2021
@noisysocks noisysocks merged commit ffbd0df into trunk Nov 15, 2021
@noisysocks noisysocks deleted the update/rename_navigation_areas_option branch November 15, 2021 03:24
@github-actions github-actions bot added this to the Gutenberg 12.0 milestone Nov 15, 2021
@noisysocks noisysocks removed the Backport to WP 6.9 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Nov 15, 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 <[email protected]>

* Lint

* Rename the remaining function calls to gutenberg_get_navigation_areas_menus

Co-authored-by: Dave Smith <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Navigation Affects the Navigation Block

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants