diff --git src/wp-includes/option.php src/wp-includes/option.php
index aa98477..2ac98bc 100644
|
|
|
function register_initial_settings() {
|
| 1737 | 1737 | 'description' => __( 'Site tagline.' ), |
| 1738 | 1738 | ) ); |
| 1739 | 1739 | |
| 1740 | | register_setting( 'general', 'siteurl', array( |
| 1741 | | 'show_in_rest' => array( |
| 1742 | | 'name' => 'url', |
| 1743 | | 'schema' => array( |
| 1744 | | 'format' => 'uri', |
| | 1740 | if ( ! is_multisite() ) { |
| | 1741 | register_setting( 'general', 'siteurl', array( |
| | 1742 | 'show_in_rest' => array( |
| | 1743 | 'name' => 'url', |
| | 1744 | 'schema' => array( |
| | 1745 | 'format' => 'uri', |
| | 1746 | ), |
| 1745 | 1747 | ), |
| 1746 | | ), |
| 1747 | | 'type' => 'string', |
| 1748 | | 'description' => __( 'Site URL.' ), |
| 1749 | | ) ); |
| | 1748 | 'type' => 'string', |
| | 1749 | 'description' => __( 'Site URL.' ), |
| | 1750 | ) ); |
| | 1751 | } |
| 1750 | 1752 | |
| 1751 | 1753 | register_setting( 'general', 'admin_email', array( |
| 1752 | 1754 | 'show_in_rest' => array( |
diff --git tests/phpunit/tests/rest-api/rest-settings-controller.php tests/phpunit/tests/rest-api/rest-settings-controller.php
index ff91a60..9970e59 100644
|
|
|
class WP_Test_REST_Settings_Controller extends WP_Test_REST_Controller_Testcase
|
| 49 | 49 | $request = new WP_REST_Request( 'GET', '/wp/v2/settings' ); |
| 50 | 50 | $response = $this->server->dispatch( $request ); |
| 51 | 51 | $data = $response->get_data(); |
| | 52 | $actual = array_keys( $data ); |
| 52 | 53 | |
| 53 | | $this->assertEquals( 200, $response->get_status() ); |
| 54 | | $this->assertEquals( array( |
| | 54 | $expected = array( |
| 55 | 55 | 'title', |
| 56 | 56 | 'description', |
| 57 | 57 | 'url', |
| … |
… |
class WP_Test_REST_Settings_Controller extends WP_Test_REST_Controller_Testcase
|
| 67 | 67 | 'posts_per_page', |
| 68 | 68 | 'default_ping_status', |
| 69 | 69 | 'default_comment_status', |
| 70 | | ), array_keys( $data ) ); |
| | 70 | ); |
| | 71 | |
| | 72 | if ( is_multisite() ) { |
| | 73 | $expected = array_diff( $expected, array( 'url' ) ); |
| | 74 | } |
| | 75 | |
| | 76 | sort( $expected ); |
| | 77 | sort( $actual ); |
| | 78 | |
| | 79 | $this->assertEquals( 200, $response->get_status() ); |
| | 80 | $this->assertEquals( $expected, $actual ); |
| 71 | 81 | } |
| 72 | 82 | |
| 73 | 83 | public function test_get_item_value_is_cast_to_type() { |