On this page
apply_filters( 'wp_generate_attachment_metadata', array $metadata, int $attachment_id, string $context )
Filters the generated attachment meta data.
Parameters
$metadataarray-
An array of attachment meta data.
$attachment_idint-
Current attachment ID.
$contextstring-
Additional context. Can be
'create'when metadata was initially created for new attachment or'update'when the metadata was updated.
Source
File: wp-admin/includes/image.php. View all references
return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id, 'create' );
Related
Used By
| Used By | Description |
|---|---|
| wp_update_image_subsizes() wp-admin/includes/image.php | If any of the currently registered image sub-sizes are missing, create them and update the image meta data. |
| wp_generate_attachment_metadata() wp-admin/includes/image.php | Generates attachment meta data and create image sub-sizes for images. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_generate_attachment_metadata