ims_download_filename

Description

The “ims_download_filename” filter is used to modify the filename for downloadable files.

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

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

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

Example

// Apply filter
function change_ims_download_filename( $filename, $image_directory, $file_type, $file_id ) {

	return "image-{$file_id}". $file_type['ext']; 
}
add_filter('ims_download_filename', 'change_ims_download_filename');

Note:  $filename is a string, $image_directory is a string, $file_type is an array with the information about the file, $file_id is an integer.


Leave a Reply

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