apply_filters( 'wp_editor_set_quality', int $quality, string $mime_type )

Filters the default image compression quality setting.


Applies only during initial editor instantiation, or when set_quality() is run manually without the $quality argument.

The WP_Image_Editor::set_quality() method has priority over the filter.

Top ↑


$quality int
Quality level between 1 (low) and 100 (high).
$mime_type string
Image mime type.

Top ↑


File: wp-includes/class-wp-image-editor.php. View all references

$quality = apply_filters( 'wp_editor_set_quality', $default_quality, $mime_type );

Top ↑


Version Description
3.5.0 Introduced.

Top ↑

User Contributed Notes

  1. Skip to note 1 content
    Contributed by Tom Auger

    This sets the default compression quality used in WP_Image_Editor, the class used for manipulating images. Do note that the if the image is a JPEG image (mime type == ‘image/jpeg’) this filter is superceded by the jpeg_quality filter and effectively will not be used.

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