Make WordPress Core

Changeset 56204


Ignore:
Timestamp:
07/11/2023 06:29:11 AM (3 years ago)
Author:
audrasjb
Message:

Docs: Fix incorrect type for $crop param is various WP_Image_Editor classes and methods.

This changeset updates the $crop docblock type in various WP_Image_Editor, WP_Image_Editor_GD and WP_Image_Editor_Imagick functions, to match the
type documented in image_resize_dimensions().

Props thunderdw.
Fixes #58271.
See #57840.

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

Legend:

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

    r56177 r56204  
    164164         * @since 3.5.0
    165165         *
    166          * @param int|null $max_w Image width.
    167          * @param int|null $max_h Image height.
    168          * @param bool    $crop
     166         * @param int|null   $max_w Image width.
     167         * @param int|null   $max_h Image height.
     168         * @param bool|array $crop
    169169         * @return true|WP_Error
    170170         */
     
    237237         *         Array of height, width values, and whether to crop.
    238238         *
    239          *         @type int  $width  Image width. Optional if `$height` is specified.
    240          *         @type int  $height Image height. Optional if `$width` is specified.
    241          *         @type bool $crop   Optional. Whether to crop the image. Default false.
     239         *         @type int        $width  Image width. Optional if `$height` is specified.
     240         *         @type int        $height Image height. Optional if `$width` is specified.
     241         *         @type bool|array $crop   Optional. Whether to crop the image. Default false.
    242242         *     }
    243243         * }
     
    266266         *     Array of size data.
    267267         *
    268          *     @type int  $width  The maximum width in pixels.
    269          *     @type int  $height The maximum height in pixels.
    270          *     @type bool $crop   Whether to crop the image to exact dimensions.
     268         *     @type int        $width  The maximum width in pixels.
     269         *     @type int        $height The maximum height in pixels.
     270         *     @type bool|array $crop   Whether to crop the image to exact dimensions.
    271271         * }
    272272         * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta,
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r56178 r56204  
    309309         * @since 3.5.0
    310310         *
    311          * @param int|null $max_w Image width.
    312          * @param int|null $max_h Image height.
    313          * @param bool    $crop
     311         * @param int|null   $max_w Image width.
     312         * @param int|null   $max_h Image height.
     313         * @param bool|array $crop
    314314         * @return true|WP_Error
    315315         */
     
    496496         *         Array of height, width values, and whether to crop.
    497497         *
    498          *         @type int  $width  Image width. Optional if `$height` is specified.
    499          *         @type int  $height Image height. Optional if `$width` is specified.
    500          *         @type bool $crop   Optional. Whether to crop the image. Default false.
     498         *         @type int        $width  Image width. Optional if `$height` is specified.
     499         *         @type int        $height Image height. Optional if `$width` is specified.
     500         *         @type bool|array $crop   Optional. Whether to crop the image. Default false.
    501501         *     }
    502502         * }
     
    525525         *     Array of size data.
    526526         *
    527          *     @type int  $width  The maximum width in pixels.
    528          *     @type int  $height The maximum height in pixels.
    529          *     @type bool $crop   Whether to crop the image to exact dimensions.
     527         *     @type int        $width  The maximum width in pixels.
     528         *     @type int        $height The maximum height in pixels.
     529         *     @type bool|array $crop   Whether to crop the image to exact dimensions.
    530530         * }
    531531         * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta,
  • trunk/src/wp-includes/class-wp-image-editor.php

    r56178 r56204  
    105105         * @abstract
    106106         *
    107          * @param int|null $max_w Image width.
    108          * @param int|null $max_h Image height.
    109          * @param bool    $crop
     107         * @param int|null   $max_w Image width.
     108         * @param int|null   $max_h Image height.
     109         * @param bool|array $crop
    110110         * @return true|WP_Error
    111111         */
     
    122122         *
    123123         *     @type array ...$0 {
    124          *         @type int  $width  Image width.
    125          *         @type int  $height Image height.
    126          *         @type bool $crop   Optional. Whether to crop the image. Default false.
     124         *         @type int        $width  Image width.
     125         *         @type int        $height Image height.
     126         *         @type bool|array $crop   Optional. Whether to crop the image. Default false.
    127127         *     }
    128128         * }
Note: See TracChangeset for help on using the changeset viewer.