Make WordPress Core

Changeset 42407


Ignore:
Timestamp:
12/16/2017 01:46:28 PM (7 years ago)
Author:
johnbillion
Message:

Media: Pass the attachment ID to the intermediate_image_sizes_advanced filter.

Props drywallbmb, robbie505
Fixes 42745

File:
1 edited

Legend:

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

    r42343 r42407  
    131131         * @since 2.9.0
    132132         * @since 4.4.0 Added the `$metadata` argument.
    133          *
    134          * @param array $sizes    An associative array of image sizes.
    135          * @param array $metadata An associative array of image metadata: width, height, file.
     133         * @since 5.0.0 Added the `$attachment_id` argument.
     134         *
     135         * @param array $sizes         An associative array of image sizes.
     136         * @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 ) {
Note: See TracChangeset for help on using the changeset viewer.