Make WordPress Core


Ignore:
Timestamp:
06/21/2022 11:16:09 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for WP_Image_Editor::save() and related functions.

Includes:

  • Documenting the returned array using hash notation.
  • Adding a @since note for the $filesize value being included in the returned array.

This affects:

  • wp_generate_attachment_metadata()
  • wp_get_attachment_metadata()
  • WP_Image_Editor::save()
  • WP_Image_Editor_GD::save() and ::_save()
  • WP_Image_Editor_Imagick::save() and ::_save()

Follow-up to [22094], [22619], [52837], [53546].

See #55646.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/image.php

    r53303 r53547  
    191191 *
    192192 * @since 5.3.0
     193 * @since 6.0.0 The `$filesize` value was added to the returned array.
    193194 * @access private
    194195 *
     
    212213    $image_meta['file'] = _wp_relative_upload_path( $new_file );
    213214
     215    // Add image file size.
     216    $image_meta['filesize'] = wp_filesize( $new_file );
     217
    214218    // Store the original image file name in image_meta.
    215219    $image_meta['original_image'] = wp_basename( $original_file );
    216 
    217     // Add image file size.
    218     $image_meta['filesize'] = wp_filesize( $new_file );
    219220
    220221    return $image_meta;
     
    478479 *
    479480 * @since 2.1.0
     481 * @since 6.0.0 The `$filesize` value was added to the returned array.
    480482 *
    481483 * @param int    $attachment_id Attachment ID to process.
Note: See TracChangeset for help on using the changeset viewer.