image_save_progressive
Filter HookDescription
Filters whether to output progressive images (if available).Hook Information
File Location |
wp-includes/class-wp-image-editor-gd.php
View on GitHub
|
Hook Type | Filter |
Line Number | 517 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$interlace
|
Whether to use progressive images for output if available. Default false. |
string
|
$mime_type
|
The mime type being saved. |
Usage Examples
Basic Usage
<?php
// Hook into image_save_progressive
add_filter('image_save_progressive', 'my_custom_filter', 10, 2);
function my_custom_filter($interlace, $mime_type) {
// Your custom filtering logic here
return $interlace;
}
Source Code Context
wp-includes/class-wp-image-editor-gd.php:517
- How this hook is used in WordPress core
<?php
512 * @since 6.5.0
513 *
514 * @param bool $interlace Whether to use progressive images for output if available. Default false.
515 * @param string $mime_type The mime type being saved.
516 */
517 imageinterlace( $image, apply_filters( 'image_save_progressive', false, $mime_type ) );
518 }
519
520 if ( 'image/gif' === $mime_type ) {
521 if ( ! $this->make_image( $filename, 'imagegif', array( $image, $filename ) ) ) {
522 return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) );
PHP Documentation
<?php
/**
* Filters whether to output progressive images (if available).
*
* @since 6.5.0
*
* @param bool $interlace Whether to use progressive images for output if available. Default false.
* @param string $mime_type The mime type being saved.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-includes/class-wp-image-editor-gd.php
Related Hooks
Related hooks will be displayed here in future updates.