function _rdf_set_field_rel_attribute in Drupal 10
Same name and namespace in other branches
- 8 core/modules/rdf/rdf.module \_rdf_set_field_rel_attribute()
- 9 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 292 - 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']);
}
}