wp_read_image_metadata_types
Filter HookDescription
Filters the image types to check for exif data.Hook Information
File Location |
wp-admin/includes/image.php
View on GitHub
|
Hook Type | Filter |
Line Number | 933 |
Hook Parameters
Type | Name | Description |
---|---|---|
int[]
|
$image_types
|
Array of image types to check for exif data. Each value is usually one of the `IMAGETYPE_*` constants. |
Usage Examples
Basic Usage
<?php
// Hook into wp_read_image_metadata_types
add_filter('wp_read_image_metadata_types', 'my_custom_filter', 10, 1);
function my_custom_filter($image_types) {
// Your custom filtering logic here
return $image_types;
}
Source Code Context
wp-admin/includes/image.php:933
- How this hook is used in WordPress core
<?php
928 * @since 2.5.0
929 *
930 * @param int[] $image_types Array of image types to check for exif data. Each value
931 * is usually one of the `IMAGETYPE_*` constants.
932 */
933 $exif_image_types = apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) );
934
935 if ( is_callable( 'exif_read_data' ) && in_array( $image_type, $exif_image_types, true ) ) {
936 // Don't silence errors when in debug mode, unless running unit tests.
937 if ( defined( 'WP_DEBUG' ) && WP_DEBUG
938 && ! defined( 'WP_RUN_CORE_TESTS' )
PHP Documentation
<?php
/**
* Filters the image types to check for exif data.
*
* @since 2.5.0
*
* @param int[] $image_types Array of image types to check for exif data. Each value
* is usually one of the `IMAGETYPE_*` constants.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-admin/includes/image.php
Related Hooks
Related hooks will be displayed here in future updates.