Media: Pass the attachment ID to the `intermediate_image_sizes_advanced` filter.
Props drywallbmb, robbie505 Fixes 42745 Built from https://develop.svn.wordpress.org/trunk@42407 git-svn-id: http://core.svn.wordpress.org/trunk@42236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3ee38c0a05
commit
cb53982d1f
|
@ -130,11 +130,13 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
|
|||
*
|
||||
* @since 2.9.0
|
||||
* @since 4.4.0 Added the `$metadata` argument.
|
||||
* @since 5.0.0 Added the `$attachment_id` argument.
|
||||
*
|
||||
* @param array $sizes An associative array of image sizes.
|
||||
* @param array $metadata An associative array of image metadata: width, height, file.
|
||||
* @param array $sizes An associative array of image sizes.
|
||||
* @param array $metadata An associative array of image metadata: width, height, file.
|
||||
* @param int $attachment_id Current attachment ID.
|
||||
*/
|
||||
$sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes, $metadata );
|
||||
$sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes, $metadata, $attachment_id );
|
||||
|
||||
if ( $sizes ) {
|
||||
$editor = wp_get_image_editor( $file );
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.0-alpha-42406';
|
||||
$wp_version = '5.0-alpha-42407';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue