mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Media: Ensure wp_mine_type_icon() returns expected file type.
Add an argument to `wp_mime_type_icon()` to control the file type returned. Following [57638], there are two file formats in the media icons directory. Different systems would pull up different files by default dependent on the order loaded into the cached array, causing intermittent test failures and unpredictable behavior. Function update allows core usages to always return the `.svg` while maintaining backwards compatibility for any extended usage that expects a `.png`. Follow up to [57638]. Also handles a missed case in media list view. Props SergeyBiryukov, sabernhardt, joedolson, antpb. Fixes #31352. git-svn-id: https://develop.svn.wordpress.org/trunk@57687 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -399,7 +399,7 @@ https://w.org</a>',
|
||||
$this->assertSame( '', $prepped['subtype'] );
|
||||
// #21963, there will be a GUID always, so there will be a URL.
|
||||
$this->assertNotEquals( '', $prepped['url'] );
|
||||
$this->assertSame( site_url( 'wp-includes/images/media/default.png' ), $prepped['icon'] );
|
||||
$this->assertSame( site_url( 'wp-includes/images/media/default.svg' ), $prepped['icon'] );
|
||||
|
||||
// Fake a mime.
|
||||
$post->post_mime_type = 'image/jpeg';
|
||||
|
||||
Reference in New Issue
Block a user