wp_read_image_metadata
Filters the array of meta data read from an image's exif data.
Usage
add_filter( 'wp_read_image_metadata', 'wp_kama_read_image_metadata_filter', 10, 5 ); /** * Function for `wp_read_image_metadata` filter-hook. * * @param array $meta Image meta data. * @param string $file Path to image file. * @param int $image_type Type of image, one of the `IMAGETYPE_XXX` constants. * @param array $iptc IPTC data. * @param array $exif EXIF data. * * @return array */ function wp_kama_read_image_metadata_filter( $meta, $file, $image_type, $iptc, $exif ){ // filter... return $meta; }
- $meta(array)
- Image meta data.
- $file(string)
- Path to image file.
- $image_type(int)
- Type of image, one of the IMAGETYPE_XXX constants.
- $iptc(array)
- IPTC data.
- $exif(array)
- EXIF data.
Changelog
Since 2.5.0 | Introduced. |
Since 4.4.0 | The $iptc parameter was added. |
Since 5.0.0 | The $exif parameter was added. |
Where the hook is called
wp_read_image_metadata
wp-admin/includes/image.php 1040
return apply_filters( 'wp_read_image_metadata', $meta, $file, $image_type, $iptc, $exif );