wp_read_image_metadata
Filter HookDescription
Filters the array of meta data read from an image's exif data.Hook Information
File Location |
wp-admin/includes/image.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1068 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$meta
|
Image meta data. |
string
|
$file
|
Path to image file. |
int
|
$image_type
|
Type of image, one of the `IMAGETYPE_XXX` constants. |
array
|
$iptc
|
IPTC data. |
array
|
$exif
|
EXIF data. |
Usage Examples
Basic Usage
<?php
// Hook into wp_read_image_metadata
add_filter('wp_read_image_metadata', 'my_custom_filter', 10, 5);
function my_custom_filter($meta, $file, $image_type, $iptc, $exif) {
// Your custom filtering logic here
return $meta;
}
Source Code Context
wp-admin/includes/image.php:1068
- How this hook is used in WordPress core
<?php
1063 * @param string $file Path to image file.
1064 * @param int $image_type Type of image, one of the `IMAGETYPE_XXX` constants.
1065 * @param array $iptc IPTC data.
1066 * @param array $exif EXIF data.
1067 */
1068 return apply_filters( 'wp_read_image_metadata', $meta, $file, $image_type, $iptc, $exif );
1069 }
1070
1071 /**
1072 * Validates that file is an image.
1073 *
PHP Documentation
<?php
/**
* Filters the array of meta data read from an image's exif data.
*
* @since 2.5.0
* @since 4.4.0 The `$iptc` parameter was added.
* @since 5.0.0 The `$exif` parameter was added.
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 5
- File: wp-admin/includes/image.php
Related Hooks
Related hooks will be displayed here in future updates.