WP_Image_Editor::save( string $destfilename = null, string $mime_type = null ): array|WP_Error
Saves current image to file.
Parameters
-
$destfilename
string Optional -
Destination filename.
Default:
null
-
$mime_type
string Optional -
The mime-type.
Default:
null
Return
array|WP_Error Array on success or WP_Error if the file failed to save.
path
stringPath to the image file.file
stringName of the image file.width
intImage width.height
intImage height.mime-type
stringThe mime type of the image.filesize
intFile size of the image.
Source
File: wp-includes/class-wp-image-editor.php
.
View all references
abstract public function save( $destfilename = null, $mime_type = null );
Changelog
Version | Description |
---|---|
6.0.0 | The $filesize value was added to the returned array. |
3.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Uppercase extension
Due to the presence of a
strtolower
inWP_Image_Editor::generate_filename
, there can be issues with uppercase file extensions on linux-like system.