Make WordPress Core

Changeset 56052


Ignore:
Timestamp:
06/27/2023 05:52:06 AM (16 months ago)
Author:
isabel_brison
Message:

Editor: add navigation fallback.

Creates a fallback menu for the Navigation block including an API endpoint to retrieve it.

Props get_dave, spacedmonkey, kebbet, flixos90, mikeschroder, ramonopoly, audrasjb.
Fixes 58557.

Location:
trunk
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r56014 r56052  
    377377    // Site Editor Export.
    378378    $controller = new WP_REST_Edit_Site_Export_Controller();
     379    $controller->register_routes();
     380
     381    // Navigation Fallback.
     382    $controller = new WP_REST_Navigation_Fallback_Controller();
    379383    $controller->register_routes();
    380384}
  • trunk/src/wp-settings.php

    r56048 r56052  
    292292require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-templates-controller.php';
    293293require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-url-details-controller.php';
     294require ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php';
    294295require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-meta-fields.php';
    295296require ABSPATH . WPINC . '/rest-api/fields/class-wp-rest-comment-meta-fields.php';
     
    322323require ABSPATH . WPINC . '/class-wp-block-parser-frame.php';
    323324require ABSPATH . WPINC . '/class-wp-block-parser.php';
     325require ABSPATH . WPINC . '/class-wp-classic-to-block-menu-converter.php';
     326require ABSPATH . WPINC . '/class-wp-navigation-fallback.php';
    324327require ABSPATH . WPINC . '/blocks.php';
    325328require ABSPATH . WPINC . '/blocks/index.php';
  • trunk/tests/qunit/fixtures/wp-api-generated.js

    r56030 r56052  
    1102211022                ]
    1102311023            }
     11024        },
     11025        "/wp-block-editor/v1/navigation-fallback": {
     11026            "namespace": "wp-block-editor/v1",
     11027            "methods": [
     11028                "GET"
     11029            ],
     11030            "endpoints": [
     11031                {
     11032                    "methods": [
     11033                        "GET"
     11034                    ],
     11035                    "args": []
     11036                }
     11037            ],
     11038            "_links": {
     11039                "self": [
     11040                    {
     11041                        "href": "http://example.org/index.php?rest_route=/wp-block-editor/v1/navigation-fallback"
     11042                    }
     11043                ]
     11044            }
    1102411045        }
    1102511046    },
Note: See TracChangeset for help on using the changeset viewer.