WP_Image_Editor::save( string $destfilename = null, string $mime_type = null )
Saves current image to file.
Parameters
- $destfilename
-
(Optional) Destination filename.
Default value: null
- $mime_type
-
(Optional) The mime-type.
Default value: null
Return
(array|WP_Error) Array on success or WP_Error if the file failed to save.<br>
- 'path'
(string) Path to the image file.<br> - 'file'
(string) Name of the image file.<br> - 'width'
(int) Image width.<br> - 'height'
(int) Image height.<br> - 'mime-type'
(string) The mime type of the image.<br> - 'filesize'
(int) File size of the image.<br>
Source
File: wp-includes/class-wp-image-editor.php
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. |