function hook_icon_pack_alter
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Render/theme.api.php \hook_icon_pack_alter()
Alter icon pack definitions.
Allows modules to modify icon pack definitions.
Parameters
array $icon_packs: The array of icon pack definitions, keyed by icon pack ID.
Related topics
1 invocation of hook_icon_pack_alter()
- IconPackManager::__construct in core/
lib/ Drupal/ Core/ Theme/ Icon/ Plugin/ IconPackManager.php - Constructs the IconPackPluginManager object.
File
-
core/
lib/ Drupal/ Core/ Render/ theme.api.php, line 1383
Code
function hook_icon_pack_alter(array &$icon_packs) : void {
// Example: Change the label of an icon pack.
if (isset($icon_packs['navigation'])) {
$icon_packs['navigation']['label'] = 'Custom navigation icons';
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.