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

---

# apply_filters( ‘load_image_to_edit_attachmenturl’, string|false $image_url, int $attachment_id, string|int[] $size )

## In this article

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

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

Filters the path to an attachment’s URL when editing the image.

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

The filter is only evaluated if the file isn’t stored locally and `allow_url_fopen`
is enabled on the server.

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

 `$image_url`string|false

Current image URL.

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

    ```php
    $filepath = apply_filters( 'load_image_to_edit_attachmenturl', wp_get_attachment_url( $attachment_id ), $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/7.1/src/wp-admin/includes/image.php#L1308)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-admin/includes/image.php#L1308-L1308)

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

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

Retrieves the path or URL of an attachment’s attached file.

  |

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

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.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_attachmenturl%2F)
before being able to contribute a note or feedback.