Changeset 59493
- Timestamp:
- 12/05/2024 09:19:37 PM (14 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-includes/embed.php (modified) (1 diff)
-
tests/phpunit/tests/oembed/getResponseData.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/embed.php
r58286 r59493 722 722 723 723 if ( $thumbnail_id ) { 724 list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $thumbnail_id, array( $width, 99999) );724 list( $thumbnail_url, $thumbnail_width, $thumbnail_height ) = wp_get_attachment_image_src( $thumbnail_id, array( $width, 0 ) ); 725 725 $data['thumbnail_url'] = $thumbnail_url; 726 726 $data['thumbnail_width'] = $thumbnail_width; -
trunk/tests/phpunit/tests/oembed/getResponseData.php
r58235 r59493 252 252 } 253 253 254 /** 255 * @ticket 62094 256 */ 257 public function test_get_oembed_response_data_has_correct_thumbnail_size() { 258 $post = self::factory()->post->create_and_get(); 259 260 /* Use a large image as post thumbnail */ 261 $attachment_id = self::factory()->attachment->create_upload_object( DIR_TESTDATA . '/images/33772.jpg' ); 262 set_post_thumbnail( $post, $attachment_id ); 263 264 /* Get the image, sized for 400x??? pixels display */ 265 $image = wp_get_attachment_image_src( $attachment_id, array( 400, 0 ) ); 266 267 /* Get the oembed data array for a 400 pixels wide embed */ 268 $data = get_oembed_response_data( $post, 400 ); 269 270 /* Make sure the embed references the small image, not the full-size one. */ 271 $this->assertSame( $image[0], $data['thumbnail_url'] ); 272 } 273 254 274 public function test_get_oembed_response_data_for_attachment() { 255 275 $parent = self::factory()->post->create();
Note: See TracChangeset
for help on using the changeset viewer.