You are here

function facebook_comments_block_page_attachments in Facebook Comments Block 8

Same name and namespace in other branches
  1. 8.2 facebook_comments_block.module \facebook_comments_block_page_attachments()

Implements hook_page_attachments().

File

./facebook_comments_block.module, line 56
facebook_comments_block.module

Code

function facebook_comments_block_page_attachments(array &$page) {
  $config = \Drupal::config('block.block.facebookcommentsblock');
  $facebook_app_id = $config
    ->get('settings')['facebook_comments_block_settings_app_id'];
  $facebook_app_id_meta = array(
    '#type' => 'html_tag',
    '#tag' => 'meta',
    '#attributes' => array(
      'property' => 'fb:app_id',
      'content' => $facebook_app_id,
    ),
  );
  $page['#attached']['html_head'][] = [
    $facebook_app_id_meta,
    'facebook_app_id_meta',
  ];
}