WP_Image_Editor::get_default_quality()protectedWP 5.8.1

Returns the default compression quality setting for the mime type.

{} It's a method of the class: WP_Image_Editor{}

No Hooks.

Return

Int. The default quality setting for the mime type.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_default_quality( $mime_type );
$mime_type(string) (required)
-

Changelog

Since 5.8.1 Introduced.

Code of WP_Image_Editor::get_default_quality() WP 6.0

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;
}