Title: image_editor_save_pre
Published: April 25, 2014
Last modified: April 28, 2025

---

# apply_filters( ‘image_editor_save_pre’, WP_Image_Editor $image, int $attachment_id )

## In this article

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

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

Filters the [WP_Image_Editor](https://developer.wordpress.org/reference/classes/wp_image_editor/)
instance for the image to be streamed to the browser.

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

 `$image`[WP_Image_Editor](https://developer.wordpress.org/reference/classes/wp_image_editor/)

The image editor instance.

`$attachment_id`int

The attachment post ID.

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

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

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

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

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

Saves image to file.

  | 
| [wp_stream_image()](https://developer.wordpress.org/reference/functions/wp_stream_image/)`wp-admin/includes/image-edit.php` |

Streams image in [WP_Image_Editor](https://developer.wordpress.org/reference/classes/wp_image_editor/) to browser.

  |

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

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

## User Contributed Notes

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