[wp-trac] [WordPress Trac] #36418: Custom MIME type icons lost in WP Media List view
WordPress Trac
noreply at wordpress.org
Fri May 29 18:58:59 UTC 2026
#36418: Custom MIME type icons lost in WP Media List view
--------------------------+------------------------------
Reporter: jhorowitz | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version:
Severity: normal | Resolution:
Keywords: dev-feedback | Focuses: administration
--------------------------+------------------------------
Comment (by hupe13):
Solved: Based on the example code from @liquidRock, I'm using the code in
my plugin that's similar to the following:
{{{#!php
<?php
add_filter( 'wp_mime_type_icon', function( $icon, $mime, $post_id ) {
if( 'application/gpx+xml' === $mime && $post_id > 0 ) {
$icon = 'https://my-domain.tld/path/to/my-icons-dir/gpx-icon.svg';
}
return $icon;
}, 10, 3 );
}}}
{{{#!php
<?php
add_filter( 'icon_dir',
function ( $path ) {
return '/path/to/my-icons-dir/';
}, 10, 1 );
}}}
And you must copy the `./wp-includes/images/media/default.svg` to
`/path/to/my-icons-dir/`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36418#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list