Changeset 52272
- Timestamp:
- 11/29/2021 10:04:48 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 5 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 18 18 # Files for local environment config 19 19 /docker-compose.override.yml 20 .idea
-
- Property svn:ignore
-
trunk/src/wp-admin/site-editor.php
r52232 r52272 100 100 '/wp/v2/global-styles/' . $active_global_styles_id, 101 101 '/wp/v2/themes/' . $active_theme . '/global-styles', 102 '/wp/v2/block-navigation-areas?context=edit',103 102 ); 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 }112 103 113 104 block_editor_rest_api_preload( $preload_paths, $block_editor_context ); -
trunk/src/wp-includes/blocks/index.php
r52069 r52272 16 16 require ABSPATH . WPINC . '/blocks/legacy-widget.php'; 17 17 require ABSPATH . WPINC . '/blocks/loginout.php'; 18 require ABSPATH . WPINC . '/blocks/navigation-area.php';19 18 require ABSPATH . WPINC . '/blocks/navigation-link.php'; 20 19 require ABSPATH . WPINC . '/blocks/navigation-submenu.php'; -
trunk/src/wp-includes/blocks/navigation.php
r52232 r52272 182 182 $parsed_blocks = gutenberg_parse_blocks_from_menu_items( $menu_items_by_parent_id[0], $menu_items_by_parent_id ); 183 183 $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 }192 184 } 193 185 -
trunk/src/wp-includes/default-filters.php
r52160 r52272 682 682 add_action( 'setup_theme', 'wp_enable_block_templates' ); 683 683 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 688 684 unset( $filter, $action ); -
trunk/src/wp-includes/rest-api.php
r52244 r52272 349 349 // Menu Locations. 350 350 $controller = new WP_REST_Menu_Locations_Controller(); 351 $controller->register_routes();352 353 // Block Navigation Areas354 $controller = new WP_REST_Block_Navigation_Areas_Controller();355 351 $controller->register_routes(); 356 352 } -
trunk/src/wp-settings.php
r52133 r52272 247 247 require ABSPATH . WPINC . '/nav-menu-template.php'; 248 248 require ABSPATH . WPINC . '/nav-menu.php'; 249 require ABSPATH . WPINC . '/navigation-areas.php';250 249 require ABSPATH . WPINC . '/admin-bar.php'; 251 250 require ABSPATH . WPINC . '/class-wp-application-passwords.php'; … … 277 276 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-plugins-controller.php'; 278 277 require 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';280 278 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php'; 281 279 require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-application-passwords-controller.php'; -
trunk/tests/phpunit/includes/functions.php
r52069 r52272 313 313 remove_action( 'init', 'register_block_core_loginout' ); 314 314 remove_action( 'init', 'register_block_core_navigation' ); 315 remove_action( 'init', 'register_block_core_navigation_area' );316 315 remove_action( 'init', 'register_block_core_navigation_link' ); 317 316 remove_action( 'init', 'register_block_core_navigation_submenu' ); -
trunk/tests/phpunit/tests/rest-api/rest-schema-setup.php
r52133 r52272 172 172 '/wp/v2/navigation/(?P<parent>[\d]+)/revisions', 173 173 '/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-]+)',176 174 '/wp-site-health/v1', 177 175 '/wp-site-health/v1/tests/background-updates', -
trunk/tests/qunit/fixtures/wp-api-generated.js
r52186 r52272 10613 10613 } 10614 10614 ] 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": false10637 }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": true10664 },10665 "args": {10666 "area": {10667 "description": "An alphanumeric identifier for the navigation area.",10668 "type": "string",10669 "required": false10670 },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": false10681 }10682 }10683 },10684 {10685 "methods": [10686 "POST",10687 "PUT",10688 "PATCH"10689 ],10690 "allow_batch": {10691 "v1": true10692 },10693 "args": {10694 "area": {10695 "description": "An alphanumeric identifier for the navigation area.",10696 "type": "string",10697 "required": false10698 }10699 }10700 }10701 ]10702 10615 } 10703 10616 }, -
trunk/tools/webpack/blocks.js
r52069 r52272 33 33 'loginout', 34 34 'navigation', 35 'navigation-area',36 35 'navigation-link', 37 36 'navigation-submenu',
Note: See TracChangeset
for help on using the changeset viewer.