Make WordPress Core

Changeset 57614


Ignore:
Timestamp:
02/13/2024 11:52:04 AM (10 months ago)
Author:
SergeyBiryukov
Message:

Docs: Revisit the canonical location for the image_save_progressive filter.

This aims to bring consistency with the image_make_intermediate_size filter, which has the main DocBlock in WP_Image_Editor_GD::_save() and a duplicate hook reference in WP_Image_Editor_Imagick::_save().

Follow-up to [57607].

See #21668.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-image-editor-gd.php

    r57607 r57614  
    506506
    507507        if ( function_exists( 'imageinterlace' ) ) {
    508             /** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
     508            /**
     509             * Filters whether to output progressive images (if available).
     510             *
     511             * @since 6.5.0
     512             *
     513             * @param bool   $interlace Whether to use progressive images for output if available. Default false.
     514             * @param string $mime_type The mime type being saved.
     515             */
    509516            imageinterlace( $image, apply_filters( 'image_save_progressive', false, $mime_type ) );
    510517        }
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r57607 r57614  
    822822        }
    823823
    824         if ( method_exists( $this->image, 'setInterlaceScheme' ) && method_exists( $this->image, 'getInterlaceScheme' ) && defined( 'Imagick::INTERLACE_PLANE' ) ) {
     824        if ( method_exists( $this->image, 'setInterlaceScheme' )
     825            && method_exists( $this->image, 'getInterlaceScheme' )
     826            && defined( 'Imagick::INTERLACE_PLANE' )
     827        ) {
    825828            $orig_interlace = $this->image->getInterlaceScheme();
    826             /**
    827              * Filters whether to output progressive images (if available).
    828              *
    829              * @since 6.5.0
    830              *
    831              * @param bool   $interlace Whether to use progressive images for output if available. Default false.
    832              * @param string $mime_type The mime type being saved.
    833              */
     829
     830            /** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
    834831            if ( apply_filters( 'image_save_progressive', false, $mime_type ) ) {
    835832                $this->image->setInterlaceScheme( Imagick::INTERLACE_PLANE ); // True - line interlace output.
     
    847844            // Reset original format.
    848845            $this->image->setImageFormat( $orig_format );
     846
    849847            if ( isset( $orig_interlace ) ) {
    850848                $this->image->setInterlaceScheme( $orig_interlace );
Note: See TracChangeset for help on using the changeset viewer.