WP_Image_Editor::save()publicWP 3.5.0

Saves current image to file.

Method of the class: WP_Image_Editor{}

No Hooks.


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


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


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.3

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