Make WordPress Core

Opened 12 months ago

Closed 10 months ago

Last modified 10 months ago

#58271 closed defect (bug) (fixed)

Docs: WP_Image_Editor classes have incorrect type for $crop in docblocks

Reported by: thunderdw's profile thunderdw Owned by: audrasjb's profile audrasjb
Milestone: 6.3 Priority: normal
Severity: trivial Version:
Component: Media Keywords: has-patch
Focuses: docs Cc:


The docblocks for the WP_Image_Editor resize() and multi_resize() functions indicate that $crop is of type bool, instead of bool|array. The implementations of these functions by WP_Image_Editor_Imagick and WP_Image_Editor_GD also have these docblock errors, and they additionally both have the error in the docblock for their make_subsize() functions.

The $crop docblock type should match the type documented in image_resize_dimensions().

Affected files:

  • wp-includes/class-wp-image-editor-gd.php
  • wp-includes/class-wp-image-editor-imagick.php
  • wp-includes/class-wp-image-editor.php

Change History (7)

#1 @audrasjb
12 months ago

  • Milestone changed from Awaiting Review to 6.3
  • Version trunk deleted

This ticket was mentioned in PR #4434 on WordPress/wordpress-develop by thunderdw.

12 months ago

  • Keywords has-patch added

This ticket was mentioned in Slack in #core-media by antpb. View the logs.

10 months ago

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.

10 months ago

#5 @audrasjb
10 months ago

  • Owner changed from thunderdw to audrasjb
  • Status changed from assigned to reviewing

Self assigning for review/commit.

#6 @audrasjb
10 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 56204:

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.

Note: See TracTickets for help on using tickets.