Changeset 43681
- Timestamp:
- 10/08/2018 06:18:25 PM (6 years ago)
- Location:
- branches/5.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r43530 r43681 373 373 // Wrap the data in a response object. 374 374 $response = rest_ensure_response( $data ); 375 $response->add_links( $links ); 375 376 foreach ( $links as $rel => $rel_links ) { 377 foreach ( $rel_links as $link ) { 378 $response->add_link( $rel, $link['href'], $link['attributes'] ); 379 } 380 } 376 381 377 382 /** -
branches/5.0/tests/phpunit/tests/rest-api/rest-attachments-controller.php
r43530 r43681 1261 1261 1262 1262 $this->assertArrayHasKey( 'self', $links ); 1263 $this->assertArrayHasKey( 'author', $links ); 1264 1265 $this->assertCount( 1, $links['author'] ); 1266 $this->assertArrayHasKey( 'embeddable', $links['author'][0]['attributes'] ); 1267 $this->assertTrue( $links['author'][0]['attributes']['embeddable'] ); 1263 1268 } 1264 1269 -
branches/5.0/tests/qunit/fixtures/wp-api-generated.js
r43442 r43681 3944 3944 "self": [ 3945 3945 { 3946 "attributes": [],3947 3946 "href": "http://example.org/index.php?rest_route=/wp/v2/media/8" 3948 3947 } … … 3950 3949 "collection": [ 3951 3950 { 3952 "attributes": [],3953 3951 "href": "http://example.org/index.php?rest_route=/wp/v2/media" 3954 3952 } … … 3956 3954 "about": [ 3957 3955 { 3958 "attributes": [],3959 3956 "href": "http://example.org/index.php?rest_route=/wp/v2/types/attachment" 3960 3957 } … … 3962 3959 "replies": [ 3963 3960 { 3964 "attributes": { 3965 "embeddable": true 3966 }, 3961 "embeddable": true, 3967 3962 "href": "http://example.org/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8" 3968 3963 }
Note: See TracChangeset
for help on using the changeset viewer.