function hook_favicon_file_uri_alter in Favicon 7.2
Alter the favicon file URI.
Parameters
string $uri: A file URI.
See also
DrupalFavicon::getFileFromUri()
1 invocation of hook_favicon_file_uri_alter()
- DrupalFavicon::getFileFromUri in src/
DrupalFavicon.php - Convert a URI into a file object.
File
- ./
favicon.api.php, line 16 - API integration for the Favicon module.
Code
function hook_favicon_file_uri_alter(&$uri) {
$basename = drupal_basename($uri);
// Allow for individual user variations of the favicon file.
$uri_with_uid = str_replace($basename, $basename . '-' . $GLOBALS['user']->uid, $uri);
if (is_file($uri_with_uid)) {
$uri = $uri_with_uid;
}
}