Changeset 60916
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r60908 r60916 1023 1023 1024 1024 if ( ! empty( $post ) ) { 1025 $links[' post'] = array(1025 $links['https://api.w.org/attached-to'] = array( 1026 1026 'href' => rest_url( rest_get_route_for_post( $post ) ), 1027 1027 'embeddable' => true, -
trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php
r60908 r60916 1888 1888 $this->assertArrayHasKey( 'self', $links ); 1889 1889 $this->assertArrayHasKey( 'author', $links ); 1890 $this->assertArrayHasKey( ' post', $links );1890 $this->assertArrayHasKey( 'https://api.w.org/attached-to', $links ); 1891 1891 1892 1892 $this->assertCount( 1, $links['author'] ); 1893 $this->assertSame( rest_url( '/wp/v2/posts/' . $post ), $links[' post'][0]['href'] );1894 $this->assertSame( 'post', $links[' post'][0]['attributes']['post_type'] );1895 $this->assertSame( $post, $links[' post'][0]['attributes']['id'] );1896 $this->assertTrue( $links[' post'][0]['attributes']['embeddable'] );1893 $this->assertSame( rest_url( '/wp/v2/posts/' . $post ), $links['https://api.w.org/attached-to'][0]['href'] ); 1894 $this->assertSame( 'post', $links['https://api.w.org/attached-to'][0]['attributes']['post_type'] ); 1895 $this->assertSame( $post, $links['https://api.w.org/attached-to'][0]['attributes']['id'] ); 1896 $this->assertTrue( $links['https://api.w.org/attached-to'][0]['attributes']['embeddable'] ); 1897 1897 } 1898 1898
Note: See TracChangeset for help on using the changeset viewer.