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.



Built from https://develop.svn.wordpress.org/trunk@56204


git-svn-id: http://core.svn.wordpress.org/trunk@55716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2023-07-11 06:31:22 +00:00
parent 36669b4f85
commit e30391f2bd
4 changed files with 25 additions and 25 deletions

View File

@ -165,7 +165,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* *
* @param int|null $max_w Image width. * @param int|null $max_w Image width.
* @param int|null $max_h Image height. * @param int|null $max_h Image height.
* @param bool $crop * @param bool|array $crop
* @return true|WP_Error * @return true|WP_Error
*/ */
public function resize( $max_w, $max_h, $crop = false ) { public function resize( $max_w, $max_h, $crop = false ) {
@ -238,7 +238,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* *
* @type int $width Image width. Optional if `$height` is specified. * @type int $width Image width. Optional if `$height` is specified.
* @type int $height Image height. Optional if `$width` is specified. * @type int $height Image height. Optional if `$width` is specified.
* @type bool $crop Optional. Whether to crop the image. Default false. * @type bool|array $crop Optional. Whether to crop the image. Default false.
* } * }
* } * }
* @return array An array of resized images' metadata by size. * @return array An array of resized images' metadata by size.
@ -267,7 +267,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
* *
* @type int $width The maximum width in pixels. * @type int $width The maximum width in pixels.
* @type int $height The maximum height in pixels. * @type int $height The maximum height in pixels.
* @type bool $crop Whether to crop the image to exact dimensions. * @type bool|array $crop Whether to crop the image to exact dimensions.
* } * }
* @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta, * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta,
* WP_Error object on error. * WP_Error object on error.

View File

@ -310,7 +310,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
* *
* @param int|null $max_w Image width. * @param int|null $max_w Image width.
* @param int|null $max_h Image height. * @param int|null $max_h Image height.
* @param bool $crop * @param bool|array $crop
* @return true|WP_Error * @return true|WP_Error
*/ */
public function resize( $max_w, $max_h, $crop = false ) { public function resize( $max_w, $max_h, $crop = false ) {
@ -497,7 +497,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
* *
* @type int $width Image width. Optional if `$height` is specified. * @type int $width Image width. Optional if `$height` is specified.
* @type int $height Image height. Optional if `$width` is specified. * @type int $height Image height. Optional if `$width` is specified.
* @type bool $crop Optional. Whether to crop the image. Default false. * @type bool|array $crop Optional. Whether to crop the image. Default false.
* } * }
* } * }
* @return array An array of resized images' metadata by size. * @return array An array of resized images' metadata by size.
@ -526,7 +526,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
* *
* @type int $width The maximum width in pixels. * @type int $width The maximum width in pixels.
* @type int $height The maximum height in pixels. * @type int $height The maximum height in pixels.
* @type bool $crop Whether to crop the image to exact dimensions. * @type bool|array $crop Whether to crop the image to exact dimensions.
* } * }
* @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta, * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta,
* WP_Error object on error. * WP_Error object on error.

View File

@ -106,7 +106,7 @@ abstract class WP_Image_Editor {
* *
* @param int|null $max_w Image width. * @param int|null $max_w Image width.
* @param int|null $max_h Image height. * @param int|null $max_h Image height.
* @param bool $crop * @param bool|array $crop
* @return true|WP_Error * @return true|WP_Error
*/ */
abstract public function resize( $max_w, $max_h, $crop = false ); abstract public function resize( $max_w, $max_h, $crop = false );
@ -123,7 +123,7 @@ abstract class WP_Image_Editor {
* @type array ...$0 { * @type array ...$0 {
* @type int $width Image width. * @type int $width Image width.
* @type int $height Image height. * @type int $height Image height.
* @type bool $crop Optional. Whether to crop the image. Default false. * @type bool|array $crop Optional. Whether to crop the image. Default false.
* } * }
* } * }
* @return array An array of resized images metadata by size. * @return array An array of resized images metadata by size.

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.3-beta3-56203'; $wp_version = '6.3-beta3-56204';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.