REST API: Add home_url
to API index to avoid confusion with site_url
.
Confusion abound, the API index is the generic term `url` to display the `site_url`. New `home` key will display the `home_url` in the index as well. Fixes #35647. git-svn-id: https://develop.svn.wordpress.org/trunk@37031 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
121bbc3b96
commit
da45e59bbd
@ -945,6 +945,7 @@ class WP_REST_Server {
|
||||
'name' => get_option( 'blogname' ),
|
||||
'description' => get_option( 'blogdescription' ),
|
||||
'url' => get_option( 'siteurl' ),
|
||||
'home' => home_url(),
|
||||
'namespaces' => array_keys( $this->namespaces ),
|
||||
'authentication' => array(),
|
||||
'routes' => $this->get_data_for_routes( $this->get_routes(), $request['context'] ),
|
||||
|
@ -644,6 +644,7 @@ class Tests_REST_Server extends WP_Test_REST_TestCase {
|
||||
$this->assertArrayHasKey( 'name', $data );
|
||||
$this->assertArrayHasKey( 'description', $data );
|
||||
$this->assertArrayHasKey( 'url', $data );
|
||||
$this->assertArrayHasKey( 'home', $data );
|
||||
$this->assertArrayHasKey( 'namespaces', $data );
|
||||
$this->assertArrayHasKey( 'authentication', $data );
|
||||
$this->assertArrayHasKey( 'routes', $data );
|
||||
|
Loading…
Reference in New Issue
Block a user