Title: wp_get_attachment_thumb_file
Published: April 25, 2014
Last modified: August 20, 2026

---

# apply_filters( ‘wp_get_attachment_thumb_file’, string $thumbfile, int $post_id )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_get_attachment_thumb_file/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/hooks/wp_get_attachment_thumb_file/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_get_attachment_thumb_file/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_get_attachment_thumb_file/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_get_attachment_thumb_file/?output_format=md#changelog)

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

Filters the attachment thumbnail file path.

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

 `$thumbfile`string

File path to the attachment thumbnail.

`$post_id`int

Attachment ID.

## 󠀁[More Information](https://developer.wordpress.org/reference/hooks/wp_get_attachment_thumb_file/?output_format=md#more-information)󠁿

The [wp_get_attachment_thumb_file()](https://developer.wordpress.org/reference/functions/wp_get_attachment_thumb_file/)
function fetches the path to the thumbnail file of a given attachment. Just before
the function returns the path, the filter is applied and the path to the file and
attachment ID are passed as parameters.

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

    ```php
    return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID );
    ```

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

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

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

Retrieves thumbnail for an attachment.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_get_attachment_thumb_file/?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_get_attachment_thumb_file%2F)
before being able to contribute a note or feedback.