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.
  1. $image_attachment = apply_filters( 'attachment_thumbnail_args', $image_attachment, $metadata, $uploaded ); 
  2.  
  3. if ( !empty( $image_attachment ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the attachment_thumbnail_args callback 
  2. function filter_attachment_thumbnail_args( $image_attachment, $metadata, $uploaded ) { 
  3. // make filter magic happen here... 
  4. return $image_attachment
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'attachment_thumbnail_args', 'filter_attachment_thumbnail_args', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. 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  
  1. $image_attachment = apply_filters( 'attachment_thumbnail_args', $image_attachment, $metadata, $uploaded );