wp_read_image_metadata

Filters the array of meta data read from an image's exif data.

Description

apply_filters( 'wp_read_image_metadata', (array) $meta, (string) $file, (int) $sourceimagetype, (array) $iptc ); 

Parameters (4)

0. $meta (array)
Image meta data.
1. $file (string)
Path to image file.
2. $sourceimagetype (int)
The sourceimagetype.
3. $iptc (array)
IPTC data.

Usage

To run the hook, copy the example below.
  1. $meta = apply_filters( 'wp_read_image_metadata', $meta, $file, $sourceimagetype, $iptc ); 
  2.  
  3. if ( !empty( $meta ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wp_read_image_metadata callback 
  2. function filter_wp_read_image_metadata( $meta, $file, $sourceimagetype, $iptc ) { 
  3. // make filter magic happen here... 
  4. return $meta
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wp_read_image_metadata', 'filter_wp_read_image_metadata', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wp_read_image_metadata', 'filter_wp_read_image_metadata', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/includes/image.php  
  1. return apply_filters( 'wp_read_image_metadata', $meta, $file, $sourceImageType, $iptc );