WordPress.org

Make WordPress Core

Ticket #42745: 42745.2.diff

File 42745.2.diff, 742 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..f23b7e3 100644
    function wp_generate_attachment_metadata( $attachment_id, $file ) { 
    133133                 *
    134134                 * @param array $sizes    An associative array of image sizes.
    135135                 * @param array $metadata An associative array of image metadata: width, height, file.
     136                 * @param int   $attachment_id Current attachment ID.
    136137                 */
    137                 $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes, $metadata );
     138                $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes, $metadata, $attachment_id );
    138139
    139140                if ( $sizes ) {
    140141                        $editor = wp_get_image_editor( $file );