WP_Image_Editor::save()publicWP 3.5.0

Saves current image to file.

Method of the class: WP_Image_Editor{}

No Hooks.

Return

Array|WP_Error. Array on success or WP_Error if the file failed to save.

Usage

$WP_Image_Editor = new WP_Image_Editor();
$WP_Image_Editor->save( $destfilename, $mime_type );
$destfilename(string)
Destination filename.
Default: null
$mime_type(string)
The mime-type.
Default: null

Changelog

Since 3.5.0 Introduced.
Since 6.0.0 The $filesize value was added to the returned array.

WP_Image_Editor::save() code WP 6.5.2

abstract public function save( $destfilename = null, $mime_type = null );