mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
REST API: Add permalink_structure to the index endpoint.
This allows Gutenberg to implement permalink editing. Props schlessera. Fixes #42465. git-svn-id: https://develop.svn.wordpress.org/trunk@42142 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user