function amp_rdf_preprocess_username in Accelerated Mobile Pages (AMP) 8.3
Implements hook_preprocess_username() for username templates.
File
- modules/
amp_rdf/ amp_rdf.module, line 76
Code
function amp_rdf_preprocess_username(&$variables) {
$amp_context = \Drupal::service('router.amp_context');
if (!$amp_context
->isAmpRoute()) {
return;
}
// Remove RDF properties incompatible with AMP specification.
if (isset($variables['attributes']['about'])) {
unset($variables['attributes']['about']);
}
if (isset($variables['attributes']['typeof'])) {
unset($variables['attributes']['typeof']);
}
if (isset($variables['attributes']['property'])) {
unset($variables['attributes']['property']);
}
if (isset($variables['attributes']['content'])) {
unset($variables['attributes']['content']);
}
if (isset($variables['attributes']['datatype'])) {
unset($variables['attributes']['datatype']);
}
}