image_save_progressive filter-hookWP 6.5.0

Filters whether to output progressive images (if available).

Usage

add_filter( 'image_save_progressive', 'wp_kama_image_save_progressive_filter', 10, 2 );

/**
 * Function for `image_save_progressive` filter-hook.
 * 
 * @param bool   $interlace Whether to use progressive images for output if available.
 * @param string $mime_type The mime type being saved.
 *
 * @return bool
 */
function wp_kama_image_save_progressive_filter( $interlace, $mime_type ){

	// filter...
	return $interlace;
}
$interlace(true|false)
Whether to use progressive images for output if available.
Default: false
$mime_type(string)
The mime type being saved.

Changelog

Since 6.5.0 Introduced.

Where the hook is called

WP_Image_Editor_GD::_save()
image_save_progressive
WP_Image_Editor_Imagick::_save()
image_save_progressive
wp-includes/class-wp-image-editor-gd.php 509
imageinterlace( $image, apply_filters( 'image_save_progressive', false, $mime_type ) );
wp-includes/class-wp-image-editor-imagick.php 841
if ( apply_filters( 'image_save_progressive', false, $mime_type ) ) {

Where the hook is used in WordPress

Usage not found.