image_save_pre
Deprecated from version 3.5.0. It is no longer supported and can be removed in future releases. See image_editor_save_pre.
Filters the GD image resource to be streamed to the browser.
Usage
add_filter( 'image_save_pre', 'wp_kama_image_save_pre_filter', 10, 3 ); /** * Function for `image_save_pre` filter-hook. * * @param resource|GdImage $image Image resource to be streamed. * @param int $attachment_id The attachment post ID. * @param $string * * @return resource|GdImage */ function wp_kama_image_save_pre_filter( $image, $attachment_id, $string ){ // filter... return $image; }
- $image(resource|GdImage)
- Image resource to be streamed.
- $attachment_id(int)
- The attachment post ID.
- $string
- -
Changelog
Since 2.9.0 | Introduced. |
Deprecated since 3.5.0 | Use {@see 'image_editor_save_pre'} instead. |
Where the hook is called
image_save_pre
wp-admin/includes/image-edit.php 375
$image = apply_filters_deprecated( 'image_save_pre', array( $image, $attachment_id ), '3.5.0', 'image_editor_save_pre' );
wp-admin/includes/image-edit.php 462
$image = apply_filters_deprecated( 'image_save_pre', array( $image, $post_id ), '3.5.0', 'image_editor_save_pre' );