diff --git a/src/wp-includes/rest-api.php b/src/wp-includes/rest-api.php
index f1892c10c4..9a64edd5d9 100644
a
|
b
|
function rest_preload_api_request( $memo, $path ) { |
1368 | 1368 | if ( 200 === $response->status ) { |
1369 | 1369 | $server = rest_get_server(); |
1370 | 1370 | $data = (array) $response->get_data(); |
1371 | | if ( method_exists( $server, 'get_compact_response_links' ) ) { |
1372 | | $links = call_user_func( array( $server, 'get_compact_response_links' ), $response ); |
1373 | | } else { |
1374 | | $links = call_user_func( array( $server, 'get_response_links' ), $response ); |
1375 | | } |
| 1371 | $links = $server->get_compact_response_links( $response ); |
1376 | 1372 | if ( ! empty( $links ) ) { |
1377 | 1373 | $data['_links'] = $links; |
1378 | 1374 | } |
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 04bd1580f7..f98d1ad57e 100644
a
|
b
|
abstract class WP_REST_Controller { |
212 | 212 | |
213 | 213 | $data = (array) $response->get_data(); |
214 | 214 | $server = rest_get_server(); |
215 | | |
216 | | if ( method_exists( $server, 'get_compact_response_links' ) ) { |
217 | | $links = call_user_func( array( $server, 'get_compact_response_links' ), $response ); |
218 | | } else { |
219 | | $links = call_user_func( array( $server, 'get_response_links' ), $response ); |
220 | | } |
| 215 | $links = $server->get_compact_response_links( $response ); |
221 | 216 | |
222 | 217 | if ( ! empty( $links ) ) { |
223 | 218 | $data['_links'] = $links; |