apply_filters( 'wp_save_image_editor_file', bool|null $override, string $filename, WP_Image_Editor $image, string $mime_type, int $post_id )
- Since
- 3.5.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
- WordPress
- since 3.5.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.
$imageWP_Image_Editor- The image editor 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:450wp_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 WP_Image_Editor $image The image editor instance. * @param string $mime_type The mime type of the image. * @param int $post_id Attachment post ID. */ $saved = apply_filters( 'wp_save_image_editor_file', null, $filename, $image, $mime_type, $post_id ); if ( null !== $saved ) { return $saved; } return $image->save( $filename, $mime_type );Changelog
Introduced in 3.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.9.7 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.