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)
Return
(int) The default quality setting for the mime type.
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;
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 5.8.1 | Introduced. |