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.
- $meta = apply_filters( 'wp_read_image_metadata', $meta, $file, $sourceimagetype, $iptc );
- if ( !empty( $meta ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the wp_read_image_metadata callback
- function filter_wp_read_image_metadata( $meta, $file, $sourceimagetype, $iptc ) {
- // make filter magic happen here...
- return $meta;
- };
- // add the filter
- add_filter( 'wp_read_image_metadata', 'filter_wp_read_image_metadata', 10, 4 );
- To remove a hook callback, use the example below.
- // remove the filter
- 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
- return apply_filters( 'wp_read_image_metadata', $meta, $file, $sourceImageType, $iptc );