apply_filters( 'attachment_thumbnail_args', array $image_attachment, array $metadata, array $uploaded )
- Since
- 3.9.0
Filters the parameters for the attachment thumbnail creation.
Compatibility
- WordPress
- since 3.9.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$image_attachmentarray- An array of parameters to create the thumbnail.
$metadataarray- Current attachment metadata.
$uploadedarray- { Information about the newly-uploaded file.
@type string $file Filename of the newly-uploaded file.
@type string $url URL of the uploaded file.
@type string $type File type.
}$filestringFilename of the newly-uploaded file.$urlstringURL of the uploaded file.$typestringFile type.
Where this hook fires · 1
wp-admin/includes/image.php:674wp_generate_attachment_metadata()
Source code
* * @type string $file Filename of the newly-uploaded file. * @type string $url URL of the uploaded file. * @type string $type File type. * } */ $image_attachment = apply_filters( 'attachment_thumbnail_args', $image_attachment, $metadata, $uploaded ); $sub_attachment_id = wp_insert_attachment( $image_attachment, $uploaded['file'] ); add_post_meta( $sub_attachment_id, '_cover_hash', $hash ); $attach_data = wp_generate_attachment_metadata( $sub_attachment_id, $uploaded['file'] ); wp_update_attachment_metadata( $sub_attachment_id, $attach_data ); update_post_meta( $attachment_id, '_thumbnail_id', $sub_attachment_id );Changelog
Introduced in 3.9.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.