diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php index ac357a0ef1..f9cf02f344 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php @@ -372,7 +372,12 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { // Wrap the data in a response object. $response = rest_ensure_response( $data ); - $response->add_links( $links ); + + foreach ( $links as $rel => $rel_links ) { + foreach ( $rel_links as $link ) { + $response->add_link( $rel, $link['href'], $link['attributes'] ); + } + } /** * Filters an attachment returned from the REST API. diff --git a/wp-includes/version.php b/wp-includes/version.php index 4c001fcdcf..4d8a14922b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-43680'; +$wp_version = '5.0-alpha-43681'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.