Changeset 58248
- Timestamp:
- 05/30/2024 01:01:44 PM (12 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r58225 r58248 6871 6871 } 6872 6872 6873 // Check if preferred file format variable is present and is a validly formatted file extension. 6874 if ( ! empty( $preferred_ext ) && is_string( $preferred_ext ) && ! str_starts_with( $preferred_ext, '.' ) ) { 6875 $preferred_ext = '.' . strtolower( $preferred_ext ); 6876 } 6877 6873 6878 $post_id = 0; 6874 6879 if ( empty( $icon ) ) { -
trunk/tests/phpunit/tests/post/attachments.php
r54226 r58248 520 520 $this->assertStringContainsString( 'images/media/video.png', $icon ); 521 521 } 522 523 /** 524 * @ticket 60610 525 */ 526 public function test_wp_mime_type_icon_video_with_preferred_ext() { 527 $icon1 = wp_mime_type_icon( 'video/mp4', '.png' ); // Added `$preferred_ext` parameter. 528 $icon2 = wp_mime_type_icon( 'video/mp4', 'png' ); // Added `$preferred_ext` parameter without period. 529 530 $this->assertStringContainsString( 'images/media/video.png', $icon1, 'Mime type icon should be correctly returned with ".png" argument.' ); 531 $this->assertStringContainsString( 'images/media/video.png', $icon2, 'Mime type icon should be correctly returned with "png" argument.' ); 532 } 522 533 }
Note: See TracChangeset
for help on using the changeset viewer.