Make WordPress Core

Changeset 52272 for trunk


Ignore:
Timestamp:
11/29/2021 10:04:48 PM (3 years ago)
Author:
spacedmonkey
Message:

Editor: Remove Navigation Areas

Navigation area were merged as part of full site editing and the new navigation block. This functionality is experimental and not currently used in WordPress core, so should be removed.

Props noisysocks, spacedmonkey, get_dave, zieladam.
Fixes #54506.

Location:
trunk
Files:
5 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1818# Files for local environment config
        1919/docker-compose.override.yml
         20.idea
  • trunk/src/wp-admin/site-editor.php

    r52232 r52272  
    100100        '/wp/v2/global-styles/' . $active_global_styles_id,
    101101        '/wp/v2/themes/' . $active_theme . '/global-styles',
    102         '/wp/v2/block-navigation-areas?context=edit',
    103102    );
    104 
    105     $areas        = get_option( 'wp_navigation_areas', array() );
    106     $active_areas = array_intersect_key( $areas, get_navigation_areas() );
    107     foreach ( $active_areas as $post_id ) {
    108         if ( $post_id ) {
    109             $preload_paths[] = add_query_arg( 'context', 'edit', rest_get_route_for_post( $post_id ) );
    110         }
    111     }
    112103
    113104    block_editor_rest_api_preload( $preload_paths, $block_editor_context );
  • trunk/src/wp-includes/blocks/index.php

    r52069 r52272  
    1616require ABSPATH . WPINC . '/blocks/legacy-widget.php';
    1717require ABSPATH . WPINC . '/blocks/loginout.php';
    18 require ABSPATH . WPINC . '/blocks/navigation-area.php';
    1918require ABSPATH . WPINC . '/blocks/navigation-link.php';
    2019require ABSPATH . WPINC . '/blocks/navigation-submenu.php';
  • trunk/src/wp-includes/blocks/navigation.php

    r52232 r52272  
    182182        $parsed_blocks           = gutenberg_parse_blocks_from_menu_items( $menu_items_by_parent_id[0], $menu_items_by_parent_id );
    183183        $inner_blocks            = new WP_Block_List( $parsed_blocks, $attributes );
    184     }
    185 
    186     if ( ! empty( $block->context['navigationArea'] ) ) {
    187         $area    = $block->context['navigationArea'];
    188         $mapping = get_option( 'wp_navigation_areas', array() );
    189         if ( ! empty( $mapping[ $area ] ) ) {
    190             $attributes['navigationMenuId'] = $mapping[ $area ];
    191         }
    192184    }
    193185
  • trunk/src/wp-includes/default-filters.php

    r52160 r52272  
    682682add_action( 'setup_theme', 'wp_enable_block_templates' );
    683683
    684 // Navigation areas.
    685 add_action( 'setup_theme', '_wp_register_default_navigation_areas' );
    686 add_action( 'switch_theme', '_wp_migrate_menu_to_navigation_post', 99, 3 );
    687 
    688684unset( $filter, $action );
  • trunk/src/wp-includes/rest-api.php

    r52244 r52272  
    349349    // Menu Locations.
    350350    $controller = new WP_REST_Menu_Locations_Controller();
    351     $controller->register_routes();
    352 
    353     // Block Navigation Areas
    354     $controller = new WP_REST_Block_Navigation_Areas_Controller();
    355351    $controller->register_routes();
    356352}
  • trunk/src/wp-settings.php

    r52133 r52272  
    247247require ABSPATH . WPINC . '/nav-menu-template.php';
    248248require ABSPATH . WPINC . '/nav-menu.php';
    249 require ABSPATH . WPINC . '/navigation-areas.php';
    250249require ABSPATH . WPINC . '/admin-bar.php';
    251250require ABSPATH . WPINC . '/class-wp-application-passwords.php';
     
    277276require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-plugins-controller.php';
    278277require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-directory-controller.php';
    279 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-navigation-areas-controller.php';
    280278require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php';
    281279require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-application-passwords-controller.php';
  • trunk/tests/phpunit/includes/functions.php

    r52069 r52272  
    313313    remove_action( 'init', 'register_block_core_loginout' );
    314314    remove_action( 'init', 'register_block_core_navigation' );
    315     remove_action( 'init', 'register_block_core_navigation_area' );
    316315    remove_action( 'init', 'register_block_core_navigation_link' );
    317316    remove_action( 'init', 'register_block_core_navigation_submenu' );
  • trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php

    r52133 r52272  
    172172            '/wp/v2/navigation/(?P<parent>[\d]+)/revisions',
    173173            '/wp/v2/navigation/(?P<parent>[\d]+)/revisions/(?P<id>[\d]+)',
    174             '/wp/v2/block-navigation-areas',
    175             '/wp/v2/block-navigation-areas/(?P<area>[\w-]+)',
    176174            '/wp-site-health/v1',
    177175            '/wp-site-health/v1/tests/background-updates',
  • trunk/tests/qunit/fixtures/wp-api-generated.js

    r52186 r52272  
    1061310613                }
    1061410614            ]
    10615         },
    10616         "/wp/v2/block-navigation-areas": {
    10617             "namespace": "wp/v2",
    10618             "methods": [
    10619                 "GET"
    10620             ],
    10621             "endpoints": [
    10622                 {
    10623                     "methods": [
    10624                         "GET"
    10625                     ],
    10626                     "args": {
    10627                         "context": {
    10628                             "description": "Scope under which the request is made; determines fields present in response.",
    10629                             "type": "string",
    10630                             "enum": [
    10631                                 "view",
    10632                                 "embed",
    10633                                 "edit"
    10634                             ],
    10635                             "default": "view",
    10636                             "required": false
    10637                         }
    10638                     }
    10639                 }
    10640             ],
    10641             "_links": {
    10642                 "self": [
    10643                     {
    10644                         "href": "http://example.org/index.php?rest_route=/wp/v2/block-navigation-areas"
    10645                     }
    10646                 ]
    10647             }
    10648         },
    10649         "/wp/v2/block-navigation-areas/(?P<area>[\\w-]+)": {
    10650             "namespace": "wp/v2",
    10651             "methods": [
    10652                 "GET",
    10653                 "POST",
    10654                 "PUT",
    10655                 "PATCH"
    10656             ],
    10657             "endpoints": [
    10658                 {
    10659                     "methods": [
    10660                         "GET"
    10661                     ],
    10662                     "allow_batch": {
    10663                         "v1": true
    10664                     },
    10665                     "args": {
    10666                         "area": {
    10667                             "description": "An alphanumeric identifier for the navigation area.",
    10668                             "type": "string",
    10669                             "required": false
    10670                         },
    10671                         "context": {
    10672                             "description": "Scope under which the request is made; determines fields present in response.",
    10673                             "type": "string",
    10674                             "enum": [
    10675                                 "view",
    10676                                 "embed",
    10677                                 "edit"
    10678                             ],
    10679                             "default": "view",
    10680                             "required": false
    10681                         }
    10682                     }
    10683                 },
    10684                 {
    10685                     "methods": [
    10686                         "POST",
    10687                         "PUT",
    10688                         "PATCH"
    10689                     ],
    10690                     "allow_batch": {
    10691                         "v1": true
    10692                     },
    10693                     "args": {
    10694                         "area": {
    10695                             "description": "An alphanumeric identifier for the navigation area.",
    10696                             "type": "string",
    10697                             "required": false
    10698                         }
    10699                     }
    10700                 }
    10701             ]
    1070210615        }
    1070310616    },
  • trunk/tools/webpack/blocks.js

    r52069 r52272  
    3333        'loginout',
    3434        'navigation',
    35         'navigation-area',
    3635        'navigation-link',
    3736        'navigation-submenu',
Note: See TracChangeset for help on using the changeset viewer.