Make WordPress Core

Changeset 37031


Ignore:
Timestamp:
03/17/2016 07:15:57 PM (8 years ago)
Author:
rachelbaker
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/class-wp-rest-server.php

    r37021 r37031  
    946946            'description'    => get_option( 'blogdescription' ),
    947947            'url'            => get_option( 'siteurl' ),
     948            'home'           => home_url(),
    948949            'namespaces'     => array_keys( $this->namespaces ),
    949950            'authentication' => array(),
  • trunk/tests/phpunit/tests/rest-api/rest-server.php

    r36829 r37031  
    645645        $this->assertArrayHasKey( 'description', $data );
    646646        $this->assertArrayHasKey( 'url', $data );
     647        $this->assertArrayHasKey( 'home', $data );
    647648        $this->assertArrayHasKey( 'namespaces', $data );
    648649        $this->assertArrayHasKey( 'authentication', $data );
Note: See TracChangeset for help on using the changeset viewer.