image_editor_save_pre filter-hookWP 3.5.0

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

wp_stream_image()
image_editor_save_pre
wp_save_image_file()
image_editor_save_pre
wp-admin/includes/image-edit.php 306
$image = apply_filters( 'image_editor_save_pre', $image, $attachment_id );
wp-admin/includes/image-edit.php 365
$image = apply_filters( 'image_editor_save_pre', $image, $post_id );

Where the hook is used in WordPress

Usage not found.