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

---

# apply_filters( ‘load_image_to_edit’, resource|GdImage $image, int $attachment_id, string|int[] $size )

## In this article

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

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

Filters the current image being loaded for editing.

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

 `$image`resource|GdImage

Current image.

`$attachment_id`int

Attachment ID.

`$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/load_image_to_edit/?output_format=md#source)󠁿

    ```php
    $image = apply_filters( 'load_image_to_edit', $image, $attachment_id, $size );
    ```

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

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

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

Loads an image resource for editing.

  |

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

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

## User Contributed Notes

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