function rdf_preprocess_html

Same name and namespace in other branches
  1. 8.9.x core/modules/rdf/rdf.module \rdf_preprocess_html()

Implements hook_preprocess_HOOK() for HTML document templates.

File

core/modules/rdf/rdf.module, line 289

Code

function rdf_preprocess_html(&$variables) {
    // Adds RDF namespace prefix bindings in the form of an RDFa 1.1 prefix
    // attribute inside the html element.
    if (!isset($variables['html_attributes']['prefix'])) {
        $variables['html_attributes']['prefix'] = [];
    }
    foreach (rdf_get_namespaces() as $prefix => $uri) {
        $variables['html_attributes']['prefix'][] = $prefix . ': ' . $uri . " ";
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.