Title: wp_mime_type_icon
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘wp_mime_type_icon’, string $icon, string $mime, int $post_id )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/?output_format=md#wp--skip-link--target)

Filters the mime type icon.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/?output_format=md#parameters)󠁿

 `$icon`string

Path to the mime type icon.

`$mime`string

Mime type.

`$post_id`int

Attachment ID. Will equal 0 if the function passed the mime type.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'wp_mime_type_icon', $icon, $mime, $post_id );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/post.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/post.php#L7323)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/post.php#L7323-L7323)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_mime_type_icon()](https://developer.wordpress.org/reference/functions/wp_mime_type_icon/)`wp-includes/post.php` |

Retrieves the icon for a MIME type or attachment.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_mime_type_icon/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_mime_type_icon%2F)
before being able to contribute a note or feedback.