WordPress.org

Make WordPress Core

Changeset 45566


Ignore:
Timestamp:
06/26/2019 06:06:32 PM (19 months ago)
Author:
SergeyBiryukov
Message:

REST API: Call WP_REST_Server::get_compact_response_links() and ::get_raw_data() static methods the right way.

Props andizer, TimothyBlynJacobs.
Fixes #47578.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

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

    r45424 r45566  
    13961396        $server = rest_get_server();
    13971397        $data   = (array) $response->get_data();
    1398         $links  = $server->get_compact_response_links( $response );
     1398        $links  = $server::get_compact_response_links( $response );
    13991399        if ( ! empty( $links ) ) {
    14001400            $data['_links'] = $links;
  • trunk/src/wp-includes/rest-api/class-wp-rest-server.php

    r43582 r45566  
    311311        $request->set_file_params( $_FILES );
    312312        $request->set_headers( $this->get_headers( wp_unslash( $_SERVER ) ) );
    313         $request->set_body( $this->get_raw_data() );
     313        $request->set_body( self::get_raw_data() );
    314314
    315315        /*
     
    438438    public function response_to_data( $response, $embed ) {
    439439        $data  = $response->get_data();
    440         $links = $this->get_compact_response_links( $response );
     440        $links = self::get_compact_response_links( $response );
    441441
    442442        if ( ! empty( $links ) ) {
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php

    r44546 r45566  
    213213        $data   = (array) $response->get_data();
    214214        $server = rest_get_server();
    215         $links  = $server->get_compact_response_links( $response );
     215        $links  = $server::get_compact_response_links( $response );
    216216
    217217        if ( ! empty( $links ) ) {
Note: See TracChangeset for help on using the changeset viewer.