You are here

function fontawesome_preprocess_icon_sprite in Font Awesome Icons 7

Same name and namespace in other branches
  1. 8.2 fontawesome.module \fontawesome_preprocess_icon_sprite()
  2. 8 fontawesome.module \fontawesome_preprocess_icon_sprite()
  3. 7.3 fontawesome.module \fontawesome_preprocess_icon_sprite()
  4. 7.2 fontawesome.module \fontawesome_preprocess_icon_sprite()

Implements hook_preprocess_icon_RENDER_HOOK().

File

./fontawesome.module, line 95
fontawesome.module Drupal integration with Font Awesome, the iconic font for use with Bootstrap.

Code

function fontawesome_preprocess_icon_sprite(&$variables) {
  $bundle =& $variables['bundle'];
  if ($bundle['provider'] === FONTAWESOME_LIBRARY) {
    $variables['attributes']['class'][] = FONTAWESOME_PREFIX;

    // Prepend the icon with the ICON prefix (which will be used as the class).
    $variables['icon'] = FONTAWESOME_PREFIX . '-' . $variables['icon'];
  }
}