Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename fse_navigation_areas to wp_navigation_areas
  • Loading branch information
noisysocks committed Nov 15, 2021
commit 81b5dafb216b2e3d908b8bb8c28e255eac999397
2 changes: 1 addition & 1 deletion src/wp-admin/site-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static function( $classes ) {
'/wp/v2/block-navigation-areas?context=edit',
);

$areas = get_option( 'fse_navigation_areas', array() );
$areas = get_option( 'wp_navigation_areas', array() );
$active_areas = array_intersect_key( $areas, get_navigation_areas() );
foreach ( $active_areas as $post_id ) {
if ( $post_id ) {
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/navigation-areas.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function _wp_migrate_menu_to_navigation_post( $new_name, WP_Theme $new_theme, WP
add_filter( 'option_stylesheet', $get_old_theme_stylesheet );

$locations = get_nav_menu_locations();
$area_mapping = get_option( 'fse_navigation_areas', array() );
$area_mapping = get_option( 'wp_navigation_areas', array() );

foreach ( $locations as $location_name => $menu_id ) {
// Get the menu from the location, skipping if there is no
Expand Down Expand Up @@ -130,7 +130,7 @@ function _wp_migrate_menu_to_navigation_post( $new_name, WP_Theme $new_theme, WP
}
remove_filter( 'option_stylesheet', $get_old_theme_stylesheet );

update_option( 'fse_navigation_areas', $area_mapping );
update_option( 'wp_navigation_areas', $area_mapping );
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ public function get_item( $request ) {
public function update_item( $request ) {
$name = $request['area'];

$mapping = get_option( 'fse_navigation_areas', array() );
$mapping = get_option( 'wp_navigation_areas', array() );
$mapping[ $name ] = $request['navigation'];
update_option( 'fse_navigation_areas', $mapping );
update_option( 'wp_navigation_areas', $mapping );

$area = $this->get_navigation_area_object( $name );
$data = $this->prepare_item_for_response( $area, $request );
Expand All @@ -196,7 +196,7 @@ public function update_item( $request ) {
*/
protected function get_navigation_area_object( $name ) {
$available_areas = get_navigation_areas();
$mapping = get_option( 'fse_navigation_areas', array() );
$mapping = get_option( 'wp_navigation_areas', array() );
$area = new stdClass();
$area->name = $name;
$area->navigation = ! empty( $mapping[ $name ] ) ? $mapping[ $name ] : null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
class Tests_REST_WpRestBlockNavigationAreasController extends WP_Test_REST_Controller_Testcase {

const OPTION = 'fse_navigation_areas';
const OPTION = 'wp_navigation_areas';

/**
* @var int Administrator user ID
Expand Down