Title: icon_dir
Published: April 25, 2014
Last modified: February 24, 2026

---

# apply_filters( ‘icon_dir’, string $path )

## In this article

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

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

Filters the icon directory path.

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

 `$path`string

Icon directory absolute path.

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

    ```php
    $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' );
    ```

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

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

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

Retrieve icon URL and Path.

  | 
| [wp_get_attachment_image_src()](https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/)`wp-includes/media.php` |

Retrieves an image to represent an attachment.

  | 
| [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/icon_dir/?output_format=md#changelog)󠁿

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

## User Contributed Notes

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