You are here

function simplemeta_preprocess_html in Simple Meta 8

Same name and namespace in other branches
  1. 8.2 simplemeta.module \simplemeta_preprocess_html()
  2. 7.2 simplemeta.module \simplemeta_preprocess_html()
  3. 7 simplemeta.module \simplemeta_preprocess_html()

Implements hook_preprocess_HOOK().

Preprocess html.

File

./simplemeta.module, line 32
Contains simplemeta.module.

Code

function simplemeta_preprocess_html(&$vars) {
  if (($entity = simplemeta_get_page_meta()) && ($data = $entity
    ->get('data')
    ->get(0)) && ($value = $data
    ->getValue()) && $value['title']) {
    $vars['head_title'] = [
      'title' => Html::escape($value['title']),
    ];
  }
}