function rdf_node_build_defaults_alter

Implements hook_ENTITY_TYPE_build_defaults_alter().

File

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

Code

function rdf_node_build_defaults_alter(array &$build, NodeInterface $node) {
    // Ensure that RSS views define the RDF namespaces.
    // @see \Drupal\node\Plugin\views\row\Rss::render()
    if (!isset($node->rss_namespaces)) {
        $node->rss_namespaces = [];
    }
    foreach (rdf_get_namespaces() as $prefix => $uri) {
        if ($prefix === 'dc') {
            continue;
        }
        $node->rss_namespaces["xmlns:{$prefix}"] = $uri;
    }
}

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