diff --git a/lib/experimental/class-wp-rest-navigation-fallback-controller.php b/lib/experimental/class-wp-rest-navigation-fallback-controller.php index 3cdbdb3fa67105..ebc1e5b9ff06a7 100644 --- a/lib/experimental/class-wp-rest-navigation-fallback-controller.php +++ b/lib/experimental/class-wp-rest-navigation-fallback-controller.php @@ -33,7 +33,7 @@ class WP_REST_Navigation_Fallback_Controller extends WP_REST_Controller { */ public function __construct() { $this->namespace = 'wp-block-editor/v1'; - $this->rest_base = 'navigation-fallbacks'; + $this->rest_base = 'navigation-fallback'; $this->post_type = 'wp_navigation'; } @@ -121,7 +121,7 @@ public function get_item_schema() { $this->schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', - 'title' => 'navigation-fallbacks', + 'title' => 'navigation-fallback', 'type' => 'object', 'properties' => array( 'id' => array( diff --git a/packages/block-library/src/navigation/edit/index.js b/packages/block-library/src/navigation/edit/index.js index 49c7378a91653f..f90bf313ff2f6f 100644 --- a/packages/block-library/src/navigation/edit/index.js +++ b/packages/block-library/src/navigation/edit/index.js @@ -229,7 +229,7 @@ function Navigation( { return; } - apiFetch( { path: '/wp-block-editor/v1/navigation-fallbacks' } ) + apiFetch( { path: '/wp-block-editor/v1/navigation-fallback' } ) .then( ( fallbackNavigationMenu ) => { if ( ! fallbackNavigationMenu?.id ) { showNavigationMenuStatusNotice( diff --git a/phpunit/class-wp-rest-navigation-fallback-controller-test.php b/phpunit/class-wp-rest-navigation-fallback-controller-test.php index 3b6a8f7adc0224..1cdedb568a5cd7 100644 --- a/phpunit/class-wp-rest-navigation-fallback-controller-test.php +++ b/phpunit/class-wp-rest-navigation-fallback-controller-test.php @@ -41,7 +41,7 @@ public function set_up() { public function test_register_routes() { $routes = rest_get_server()->get_routes(); - $this->assertArrayHasKey( '/wp-block-editor/v1/navigation-fallbacks', $routes, 'Fallback route should be registered.' ); + $this->assertArrayHasKey( '/wp-block-editor/v1/navigation-fallback', $routes, 'Fallback route should be registered.' ); } /** @@ -53,7 +53,7 @@ public function test_should_not_return_menus_for_users_without_permissions() { wp_set_current_user( self::$editor_user ); - $request = new WP_REST_Request( 'GET', '/wp-block-editor/v1/navigation-fallbacks' ); + $request = new WP_REST_Request( 'GET', '/wp-block-editor/v1/navigation-fallback' ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); @@ -71,7 +71,7 @@ public function test_should_not_return_menus_for_users_without_permissions() { */ public function test_get_item() { - $request = new WP_REST_Request( 'GET', '/wp-block-editor/v1/navigation-fallbacks' ); + $request = new WP_REST_Request( 'GET', '/wp-block-editor/v1/navigation-fallback' ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); @@ -96,7 +96,7 @@ public function test_get_item() { * @since 6.3.0 Added Navigation Fallbacks endpoint. */ public function test_get_item_schema() { - $request = new WP_REST_Request( 'OPTIONS', '/wp-block-editor/v1/navigation-fallbacks' ); + $request = new WP_REST_Request( 'OPTIONS', '/wp-block-editor/v1/navigation-fallback' ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data(); @@ -119,7 +119,7 @@ public function test_get_item_schema() { * @since 6.3.0 Added Navigation Fallbacks endpoint. */ public function test_adds_links() { - $request = new WP_REST_Request( 'GET', '/wp-block-editor/v1/navigation-fallbacks' ); + $request = new WP_REST_Request( 'GET', '/wp-block-editor/v1/navigation-fallback' ); $response = rest_get_server()->dispatch( $request ); $data = $response->get_data();