wp_save_image_file
Deprecated from version 3.5.0. It is no longer supported and can be removed in future releases. See wp_save_image_editor_file.
Filters whether to skip saving the image file.
Returning a non-null value will short-circuit the save method, returning that value instead.
Usage
add_filter( 'wp_save_image_file', 'wp_kama_save_image_file_filter', 10, 3 ); /** * Function for `wp_save_image_file` filter-hook. * * @param bool|null $override Value to return instead of saving. * @param string $filename Name of the file to be saved. * @param resource|GdImage $image Image resource or GdImage instance. * * @return bool|null */ function wp_kama_save_image_file_filter( $override, $filename, $image ){ // filter... return $override; }
- $override(true|false|null)
- Value to return instead of saving.
Default: null - $filename(string)
- Name of the file to be saved.
- $image(resource|GdImage)
- Image resource or GdImage instance.
Changelog
Since 2.9.0 | Introduced. |
Deprecated since 3.5.0 | Use {@see 'wp_save_image_editor_file'} instead. |
Where the hook is called
wp-admin/includes/image-edit.php 479-484
$saved = apply_filters_deprecated( 'wp_save_image_file', array( null, $filename, $image, $mime_type, $post_id ), '3.5.0', 'wp_save_image_editor_file' );