WordPress.org

Make WordPress Core

Ticket #42745: 42745.4.diff

File 42745.4.diff, 876 bytes (added by drywallbmb, 2 years ago)
  • src/wp-admin/includes/image.php

    diff --git src/wp-admin/includes/image.php src/wp-admin/includes/image.php
    index 3fe8cc8..126a8c4 100644
    function wp_generate_attachment_metadata( $attachment_id, $file ) { 
    130130                 *
    131131                 * @since 2.9.0
    132132                 * @since 4.4.0 Added the `$metadata` argument.
     133                 * @since 5.0.0 Added the `$attachment_id` argument.
    133134                 *
    134135                 * @param array $sizes    An associative array of image sizes.
    135136                 * @param array $metadata An associative array of image metadata: width, height, file.
     137                 * @param int   $attachment_id Current attachment ID.
    136138                 */
    137                 $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes, $metadata );
     139                $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes, $metadata, $attachment_id );
    138140
    139141                if ( $sizes ) {
    140142                        $editor = wp_get_image_editor( $file );