attachment_thumbnail_args
Filters the parameters for the attachment thumbnail creation.
Description
apply_filters( 'attachment_thumbnail_args', (array) $image_attachment, (array) $metadata, (array) $uploaded );
Parameters (3)
- 0. $image_attachment (array)
- An array of parameters to create the thumbnail.
- 1. $metadata (array)
- Current attachment metadata.
- 2. $uploaded (array)
- An array containing the thumbnail path and url.
Usage
- To run the hook, copy the example below.
- $image_attachment = apply_filters( 'attachment_thumbnail_args', $image_attachment, $metadata, $uploaded );
- if ( !empty( $image_attachment ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the attachment_thumbnail_args callback
- function filter_attachment_thumbnail_args( $image_attachment, $metadata, $uploaded ) {
- // make filter magic happen here...
- return $image_attachment;
- };
- // add the filter
- add_filter( 'attachment_thumbnail_args', 'filter_attachment_thumbnail_args', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'attachment_thumbnail_args', 'filter_attachment_thumbnail_args', 10, 3 );
Defined (1)
The filter is defined in the following location(s).
- /wp-admin/includes/image.php
- $image_attachment = apply_filters( 'attachment_thumbnail_args', $image_attachment, $metadata, $uploaded );