Saves current image to file.
Parameters
$destfilename
stringoptional- Destination filename.
Default:
null
$mime_type
stringoptional- The mime-type.
Default:
null
Source
public function save( $destfilename = null, $mime_type = null ) {
$saved = $this->_save( $this->image, $destfilename, $mime_type );
if ( ! is_wp_error( $saved ) ) {
$this->file = $saved['path'];
$this->mime_type = $saved['mime-type'];
try {
$this->image->setImageFormat( strtoupper( $this->get_extension( $this->mime_type ) ) );
} catch ( Exception $e ) {
return new WP_Error( 'image_save_error', $e->getMessage(), $this->file );
}
}
return $saved;
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.