WP_Image_Editor::get_default_quality() WordPress Method

The WP_Image_Editor::get_default_quality() function returns the default image quality value for the editor. This value is used when the image quality is set to 'default'.

WP_Image_Editor::get_default_quality( string $mime_type ) #

Returns the default compression quality setting for the mime type.


Parameters

$mime_type

(string)(Required)


Top ↑

Return

(int) The default quality setting for the mime type.


Top ↑

Source

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

	protected function get_default_quality( $mime_type ) {
		switch ( $mime_type ) {
			case 'image/webp':
				$quality = 86;
				break;
			case 'image/jpeg':
			default:
				$quality = $this->default_quality;
		}

		return $quality;
	}


Top ↑

Changelog

Changelog
VersionDescription
5.8.1Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.