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