Title: image_get_intermediate_size
Published: December 9, 2015
Last modified: February 24, 2026

---

# apply_filters( ‘image_get_intermediate_size’, array $data, int $post_id, string|int[] $size )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/image_get_intermediate_size/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/hooks/image_get_intermediate_size/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/hooks/image_get_intermediate_size/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/image_get_intermediate_size/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/image_get_intermediate_size/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/image_get_intermediate_size/?output_format=md#changelog)

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

Filters the output of [image_get_intermediate_size()](https://developer.wordpress.org/reference/functions/image_get_intermediate_size/)

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/image_get_intermediate_size/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/hooks/image_get_intermediate_size/?output_format=md#see-also)󠁿

 * [image_get_intermediate_size()](https://developer.wordpress.org/reference/functions/image_get_intermediate_size/)

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

 `$data`array

Array of file relative path, width, and height on success. May also include file
absolute path and URL.

`$post_id`int

The ID of the image attachment.

`$size`string|int[]

Requested image size. Can be any registered image size name, or an array of width
and height values in pixels (in that order).

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

    ```php
    return apply_filters( 'image_get_intermediate_size', $data, $post_id, $size );
    ```

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

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

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

Retrieves the image’s intermediate size (resized) path, width, and height.

  |

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

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

## User Contributed Notes

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