Skip to content

Commit 29a8f34

Browse files
Upload: Add wp_before_make_subsizes hook for pre-thumbnail processing
1 parent 32bca45 commit 29a8f34

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/wp-admin/includes/image.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,18 @@ function _wp_make_subsizes( $new_sizes, $file, $image_meta, $attachment_id ) {
468468

469469
$new_sizes = array_filter( array_merge( $priority, $new_sizes ) );
470470

471+
/**
472+
* Fires before creating image sub-sizes.
473+
*
474+
* @since 6.9.0
475+
*
476+
* @param array $new_sizes Array defining what sizes to create.
477+
* @param string $file Full path to the image file.
478+
* @param array $image_meta The attachment meta data array.
479+
* @param int $attachment_id Attachment ID to process.
480+
*/
481+
do_action( 'wp_before_make_subsizes', $new_sizes, $file, $image_meta, $attachment_id );
482+
471483
$editor = wp_get_image_editor( $file );
472484

473485
if ( is_wp_error( $editor ) ) {

0 commit comments

Comments
 (0)