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 c69cb4834c..d06974682a 100644 --- a/src/wp-includes/rest-api/class-wp-rest-server.php +++ b/src/wp-includes/rest-api/class-wp-rest-server.php @@ -1017,15 +1017,16 @@ 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' ), - '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' ), + 'permalink_structure' => get_option( 'permalink_structure' ), + '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 cb75f4e726..37b96fdd33 100644 --- a/tests/phpunit/tests/rest-api/rest-server.php +++ b/tests/phpunit/tests/rest-api/rest-server.php @@ -665,6 +665,7 @@ 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 8c9684c9de..d0882f3249 100644 --- a/tests/qunit/fixtures/wp-api-generated.js +++ b/tests/qunit/fixtures/wp-api-generated.js @@ -12,6 +12,7 @@ mockedApiResponse.Schema = { "home": "http://example.org", "gmt_offset": "0", "timezone_string": "", + "permalink_structure": false, "namespaces": [ "oembed/1.0", "wp/v2"