function facebook_comments_block_page_attachments in Facebook Comments Block 8.2
Same name and namespace in other branches
- 8 facebook_comments_block.module \facebook_comments_block_page_attachments()
Implements hook_page_attachments().
File
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',
];
}