diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php index adcca17d3b..716b425e57 100644 --- a/src/wp-includes/rest-api.php +++ b/src/wp-includes/rest-api.php @@ -1395,7 +1395,7 @@ function rest_preload_api_request( $memo, $path ) { if ( 200 === $response->status ) { $server = rest_get_server(); $data = (array) $response->get_data(); - $links = $server->get_compact_response_links( $response ); + $links = $server::get_compact_response_links( $response ); if ( ! empty( $links ) ) { $data['_links'] = $links; } diff --git a/src/wp-includes/rest-api/class-wp-rest-server.php b/src/wp-includes/rest-api/class-wp-rest-server.php index 0e71ef966e..252daf3e99 100644 --- a/src/wp-includes/rest-api/class-wp-rest-server.php +++ b/src/wp-includes/rest-api/class-wp-rest-server.php @@ -310,7 +310,7 @@ class WP_REST_Server { $request->set_body_params( wp_unslash( $_POST ) ); $request->set_file_params( $_FILES ); $request->set_headers( $this->get_headers( wp_unslash( $_SERVER ) ) ); - $request->set_body( $this->get_raw_data() ); + $request->set_body( self::get_raw_data() ); /* * HTTP method override for clients that can't use PUT/PATCH/DELETE. First, we check @@ -437,7 +437,7 @@ class WP_REST_Server { */ public function response_to_data( $response, $embed ) { $data = $response->get_data(); - $links = $this->get_compact_response_links( $response ); + $links = self::get_compact_response_links( $response ); if ( ! empty( $links ) ) { // Convert links to part of the data. diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php index d610504692..6188bff380 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php @@ -212,7 +212,7 @@ abstract class WP_REST_Controller { $data = (array) $response->get_data(); $server = rest_get_server(); - $links = $server->get_compact_response_links( $response ); + $links = $server::get_compact_response_links( $response ); if ( ! empty( $links ) ) { $data['_links'] = $links;