Make WordPress Core

Changeset 62517


Ignore:
Timestamp:
06/17/2026 11:34:55 AM (3 months ago)
Author:
SergeyBiryukov
Message:

Media: Make ::update_size() parameters consistent across image editors.

Includes:

  • Standardizing default values on null vs. false.
  • Updating the documentation to correct parameter types.
  • Adding missing parameter descriptions.

Follow-up to [22094].

Props Soean, mukesh27, SergeyBiryukov.
See #64897.

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

Legend:

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

    r60703 r62517  
    145145         * @since 3.5.0
    146146         *
    147          * @param int $width
    148          * @param int $height
     147         * @param int|null $width  Image width.
     148         * @param int|null $height Image height.
    149149         * @return true
    150150         */
    151         protected function update_size( $width = false, $height = false ) {
     151        protected function update_size( $width = null, $height = null ) {
    152152                if ( ! $width ) {
    153153                        $width = imagesx( $this->image );
  • trunk/src/wp-includes/class-wp-image-editor-imagick.php

    r60669 r62517  
    248248         * @since 3.5.0
    249249         *
    250          * @param int $width
    251          * @param int $height
     250         * @param int|null $width  Image width.
     251         * @param int|null $height Image height.
    252252         * @return true|WP_Error
    253253         */
    254254        protected function update_size( $width = null, $height = null ) {
    255255                $size = null;
     256
    256257                if ( ! $width || ! $height ) {
    257258                        try {
  • trunk/src/wp-includes/class-wp-image-editor.php

    r61387 r62517  
    202202         * @since 3.5.0
    203203         *
    204          * @param int $width
    205          * @param int $height
     204         * @param int|null $width  Image width.
     205         * @param int|null $height Image height.
    206206         * @return true
    207207         */
Note: See TracChangeset for help on using the changeset viewer.