function _rdf_set_field_rel_attribute in Drupal 9
Same name and namespace in other branches
- 8 core/modules/rdf/rdf.module \_rdf_set_field_rel_attribute()
Transforms the field property attribute into a rel attribute.
1 call to _rdf_set_field_rel_attribute()
- rdf_preprocess_field__node__uid in core/
modules/ rdf/ rdf.module - Implements hook_preprocess_HOOK() for UID field templates.
File
- core/
modules/ rdf/ rdf.module, line 289 - Enables semantically enriched output for Drupal sites in the form of RDFa.
Code
function _rdf_set_field_rel_attribute(&$variables) {
// Swap the regular field property attribute and use the rel attribute
// instead so that it plays well with the RDFa markup when only a link is
// present in the field output, for example in the case of the uid field.
if (!empty($variables['attributes']['property'])) {
$variables['attributes']['rel'] = $variables['attributes']['property'];
unset($variables['attributes']['property']);
}
}