Make WordPress Core

Ticket #39854: 39854.3.patch

File 39854.3.patch, 652 bytes (added by sagarkbhatt, 7 years ago)

Updated patch according to discussion.

  • wp-includes/rest-api/class-wp-rest-server.php

    diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php
    index 4f5ae76..be75b35 100644
    a b class WP_REST_Server { 
    10211021                        'routes'         => $this->get_data_for_routes( $this->get_routes(), $request['context'] ),
    10221022                );
    10231023
     1024                if ( 'edit' === $request['context'] ) {
     1025                        if ( is_user_logged_in() ) {
     1026                                $available['gmt_offset'] = get_option( 'gmt_offset' );
     1027                        }
     1028                }
     1029
    10241030                $response = new WP_REST_Response( $available );
    10251031
    10261032                $response->add_link( 'help', 'http://v2.wp-api.org/' );