Filter hook 'getimagesize_mimes_to_exts'

in WP Core File wp-includes/functions.php at line 3124

View Source

getimagesize_mimes_to_exts

Filter Hook
Description
Filters the list mapping image mime types to their respective extensions.

Hook Information

File Location wp-includes/functions.php View on GitHub
Hook Type Filter
Line Number 3124

Hook Parameters

Type Name Description
array $mime_to_ext Array of image mime types and their matching extensions.

Usage Examples

Basic Usage
<?php
// Hook into getimagesize_mimes_to_exts
add_filter('getimagesize_mimes_to_exts', 'my_custom_filter', 10, 1);

function my_custom_filter($mime_to_ext) {
    // Your custom filtering logic here
    return $mime_to_ext;
}

Source Code Context

wp-includes/functions.php:3124 - How this hook is used in WordPress core
<?php
3119  			 *
3120  			 * @since 3.0.0
3121  			 *
3122  			 * @param array $mime_to_ext Array of image mime types and their matching extensions.
3123  			 */
3124  			$mime_to_ext = apply_filters(
3125  				'getimagesize_mimes_to_exts',
3126  				array(
3127  					'image/jpeg'          => 'jpg',
3128  					'image/png'           => 'png',
3129  					'image/gif'           => 'gif',

PHP Documentation

<?php
/**
			 * Filters the list mapping image mime types to their respective extensions.
			 *
			 * @since 3.0.0
			 *
			 * @param array $mime_to_ext Array of image mime types and their matching extensions.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/functions.php
Related Hooks

Related hooks will be displayed here in future updates.