apply_filters( ‘wp_generate_attachment_metadata’, array $metadata, int $attachment_id, string $context )

In this article

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

return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id, 'create' );

Changelog

VersionDescription
5.3.0The $context parameter was added.
2.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.