WP_Image_Editor_GD::save( string|null $filename = null, string|null $mime_type = null )

Saves current in-memory image to file.


Description Description


Parameters Parameters

$filename

(string|null) (Optional)

Default value: null

$mime_type

(string|null) (Optional)

Default value: null


Top ↑

Return Return

(array|WP_Error) 'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string


Top ↑

Source Source

File: wp-includes/class-wp-image-editor-gd.php

	public function save( $filename = null, $mime_type = null ) {
		$saved = $this->_save( $this->image, $filename, $mime_type );

		if ( ! is_wp_error( $saved ) ) {
			$this->file      = $saved['path'];
			$this->mime_type = $saved['mime-type'];
		}

		return $saved;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.