attachment_thumbnail_args
Filters the parameters for the attachment thumbnail creation.
Usage
add_filter( 'attachment_thumbnail_args', 'wp_kama_attachment_thumbnail_args_filter', 10, 3 ); /** * Function for `attachment_thumbnail_args` filter-hook. * * @param array $image_attachment An array of parameters to create the thumbnail. * @param array $metadata Current attachment metadata. * @param array $uploaded Information about the newly-uploaded file. * * @return array */ function wp_kama_attachment_thumbnail_args_filter( $image_attachment, $metadata, $uploaded ){ // filter... return $image_attachment; }
- $image_attachment(array)
- An array of parameters to create the thumbnail.
- $metadata(array)
- Current attachment metadata.
- $uploaded(array)
Information about the newly-uploaded file.
-
file(string)
Filename of the newly-uploaded file. -
url(string)
URL of the uploaded file. - type(string)
File type.
-
Changelog
Since 3.9.0 | Introduced. |
Where the hook is called
wp-admin/includes/image.php 632
$image_attachment = apply_filters( 'attachment_thumbnail_args', $image_attachment, $metadata, $uploaded );