You are here

imagecache_external.api.php in Imagecache External 8

Same filename and directory in other branches
  1. 7.2 imagecache_external.api.php

Documentation of Imagecache External hooks.

File

imagecache_external.api.php
View 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

Namesort descending Description
hook_imagecache_external_needs_refresh_alter Add custom image refresh logic.