imagecache_external.api.php in Imagecache External 8
Same filename and directory in other branches
Documentation of Imagecache External hooks.
File
imagecache_external.api.phpView source
<?php
/**
* @file
* Documentation of Imagecache External hooks.
*/
/**
* Add custom image refresh logic.
*
* Use this hook to add extra validation(s) whether to refresh images.
*/
function hook_imagecache_external_needs_refresh_alter(&$needs_refresh, $filepath) {
// Example: refresh images at least once a week.
if (filemtime($filepath) > \Drupal::time()
->getRequestTime() - 60 * 60 * 24 * 7) {
$needs_refresh = TRUE;
}
}
Functions
Name | Description |
---|---|
hook_imagecache_external_needs_refresh_alter | Add custom image refresh logic. |