From f9e4467b3db7d8bc83a82fded8326158309ec107 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 23 Apr 2018 04:11:42 +0000 Subject: [PATCH] REST API: Remove `permalink_structure` from the index. This was originally added to allow Gutenberg to do permalink editing, but is no longer required. It's also superceded by #41014. Reverts [42142]. Fixes #42465. git-svn-id: https://develop.svn.wordpress.org/trunk@42997 602fd350-edb4-49c9-b593-d223f7449a82 --- .../rest-api/class-wp-rest-server.php | 19 +++++++++---------- tests/phpunit/tests/rest-api/rest-server.php | 1 - tests/qunit/fixtures/wp-api-generated.js | 1 - 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/wp-includes/rest-api/class-wp-rest-server.php b/src/wp-includes/rest-api/class-wp-rest-server.php index 51183dadb1..d758a3b128 100644 --- a/src/wp-includes/rest-api/class-wp-rest-server.php +++ b/src/wp-includes/rest-api/class-wp-rest-server.php @@ -1022,16 +1022,15 @@ class WP_REST_Server { public function get_index( $request ) { // General site data. $available = array( - 'name' => get_option( 'blogname' ), - 'description' => get_option( 'blogdescription' ), - 'url' => get_option( 'siteurl' ), - 'home' => home_url(), - 'gmt_offset' => get_option( 'gmt_offset' ), - 'timezone_string' => get_option( 'timezone_string' ), - 'permalink_structure' => get_option( 'permalink_structure' ), - 'namespaces' => array_keys( $this->namespaces ), - 'authentication' => array(), - 'routes' => $this->get_data_for_routes( $this->get_routes(), $request['context'] ), + 'name' => get_option( 'blogname' ), + 'description' => get_option( 'blogdescription' ), + 'url' => get_option( 'siteurl' ), + 'home' => home_url(), + 'gmt_offset' => get_option( 'gmt_offset' ), + 'timezone_string' => get_option( 'timezone_string' ), + 'namespaces' => array_keys( $this->namespaces ), + 'authentication' => array(), + 'routes' => $this->get_data_for_routes( $this->get_routes(), $request['context'] ), ); $response = new WP_REST_Response( $available ); diff --git a/tests/phpunit/tests/rest-api/rest-server.php b/tests/phpunit/tests/rest-api/rest-server.php index dd4f70b1e3..9d02fea04a 100644 --- a/tests/phpunit/tests/rest-api/rest-server.php +++ b/tests/phpunit/tests/rest-api/rest-server.php @@ -705,7 +705,6 @@ class Tests_REST_Server extends WP_Test_REST_TestCase { $this->assertArrayHasKey( 'home', $data ); $this->assertArrayHasKey( 'gmt_offset', $data ); $this->assertArrayHasKey( 'timezone_string', $data ); - $this->assertArrayHasKey( 'permalink_structure', $data ); $this->assertArrayHasKey( 'namespaces', $data ); $this->assertArrayHasKey( 'authentication', $data ); $this->assertArrayHasKey( 'routes', $data ); diff --git a/tests/qunit/fixtures/wp-api-generated.js b/tests/qunit/fixtures/wp-api-generated.js index 2f605063fc..6bfb11603f 100644 --- a/tests/qunit/fixtures/wp-api-generated.js +++ b/tests/qunit/fixtures/wp-api-generated.js @@ -12,7 +12,6 @@ mockedApiResponse.Schema = { "home": "http://example.org", "gmt_offset": "0", "timezone_string": "", - "permalink_structure": false, "namespaces": [ "oembed/1.0", "wp/v2"