wppaste
WordPress

apply_filters_deprecated( 'wp_save_image_file', bool|null $override, string $filename, resource|GdImage $image, string $mime_type, int $post_id )

Since
2.9.0
Filters whether to skip saving the image file.

Description

Returning a non-null value will short-circuit the save method, returning that value instead.

Compatibility

Deprecated in WordPress 3.5.0. Use {@see 'wp_save_image_editor_file'} instead.

WordPress
since 2.9.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$overridebool|null
Value to return instead of saving. Default null.
$filenamestring
Name of the file to be saved.
$imageresource|GdImage
Image resource or GdImage instance.
$mime_typestring
The mime type of the image.
$post_idint
Attachment post ID.

Where this hook fires · 1

  • wp-admin/includes/image-edit.php:484wp_save_image_file()

Source code

		 * @param bool|null        $override  Value to return instead of saving. Default null.		 * @param string           $filename  Name of the file to be saved.		 * @param resource|GdImage $image     Image resource or GdImage instance.		 * @param string           $mime_type The mime type of the image.		 * @param int              $post_id   Attachment post ID.		 */		$saved = apply_filters_deprecated(			'wp_save_image_file',			array( null, $filename, $image, $mime_type, $post_id ),			'3.5.0',			'wp_save_image_editor_file'		);

Changelog

Introduced in 2.9.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

3.5.0
Deprecated. Use 'wp_save_image_editor_file' instead.from the docblock
2.9.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.