You are here

function floating_social_icons_page_attachments in Floating Social Icons 8

Implements hook_page_attachments().

File

./floating_social_icons.module, line 51
Contains floating_social_icons.module.

Code

function floating_social_icons_page_attachments(array &$attachments) {

  // Check for admin
  $current_user = \Drupal::currentUser();
  $roles = $current_user
    ->getRoles();
  if (in_array("administrator", $roles)) {
    $attachments['#attached']['library'][] = 'floating_social_icons/floating_admin_icons';
  }
}