ims_generate_image_metadata

Description

The “ims_generate_image_metadata” filter is used to modify the image metadata array created after each image is uploaded.

A plugin (or theme) can modify the array with the code:

<?php add_filter( 'ims_generate_image_metadata', 'filter_function_name'); ?>

The hook is located in the image-store/_inc/admin.php file.

Example

// Apply filter
function add_ims_image_metadata( $metadata, $attachment_id, $path ) {
$metadata['photo_version'] = 2;
return $metadata; 
}
add_filter('ims_generate_image_metadata', 'add_ims_image_metadata');

Note: $metadata is multidimensional array saved into the “_wp_attachment_metadata” post meta option, $attachment_id is an integer, $path is string path to the original file.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *