diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php
index 4f5ae76..9d3f956 100644
a
|
b
|
class WP_REST_Server { |
1011 | 1011 | */ |
1012 | 1012 | public function get_index( $request ) { |
1013 | 1013 | // General site data. |
| 1014 | $context = $request->get_param( 'context' ); |
| 1015 | $available_edit = array(); |
| 1016 | if ( 'edit' === $context && ! current_user_can( 'edit_posts' ) ) { |
| 1017 | return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you cannot view this resource with edit context.' ), array( 'status' => rest_authorization_required_code() ) ); |
| 1018 | } |
| 1019 | if ( 'edit' === $context && current_user_can( 'edit_posts' ) ) { |
| 1020 | $available_edit['gmt_offset'] = get_option( 'gmt_offset' ); |
| 1021 | } |
1014 | 1022 | $available = array( |
1015 | 1023 | 'name' => get_option( 'blogname' ), |
1016 | 1024 | 'description' => get_option( 'blogdescription' ), |
… |
… |
class WP_REST_Server { |
1020 | 1028 | 'authentication' => array(), |
1021 | 1029 | 'routes' => $this->get_data_for_routes( $this->get_routes(), $request['context'] ), |
1022 | 1030 | ); |
1023 | | |
| 1031 | $available = wp_parse_args( $available, $available_edit ); |
1024 | 1032 | $response = new WP_REST_Response( $available ); |
1025 | 1033 | |
1026 | 1034 | $response->add_link( 'help', 'http://v2.wp-api.org/' ); |