image_editor_save_pre
Filters the WP_Image_Editor instance for the image to be streamed to the browser.
Usage
add_filter( 'image_editor_save_pre', 'wp_kama_image_editor_save_pre_filter', 10, 2 ); /** * Function for `image_editor_save_pre` filter-hook. * * @param WP_Image_Editor $image The image editor instance. * @param int $attachment_id The attachment post ID. * * @return WP_Image_Editor */ function wp_kama_image_editor_save_pre_filter( $image, $attachment_id ){ // filter... return $image; }
- $image(WP_Image_Editor)
- The image editor instance.
- $attachment_id(int)
- The attachment post ID.
Changelog
Since 3.5.0 | Introduced. |
Where the hook is called
image_editor_save_pre
wp-admin/includes/image-edit.php 355
$image = apply_filters( 'image_editor_save_pre', $image, $attachment_id );
wp-admin/includes/image-edit.php 434
$image = apply_filters( 'image_editor_save_pre', $image, $post_id );