The “ims_before_attachment_metadata” action runs before the image metadata for an uploaded image has been generated by wp_generate_attachment_metadata().

A plugin (or theme) can add an action with the code:

<?php add_action( 'ims_before_attachment_metadata', 'filter_function_name'); ?>

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


// apply action
function action_ims_before_attachment_metadata( $attach_id, $filepath, $file ) {
	 //run some action here
add_action('ims_before_attachment_metadata', 'action_ims_before_attachment_metadata');

Note: $attach_id is an integer, $filepath is a string, $file is an numeric array returned by pathinfo().

Leave a Reply

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