public function CustomMetaTagProperty::output in Custom Meta 2.0.x
File
- src/
Plugin/ metatag/ Tag/ CustomMetaTagProperty.php, line 30
Class
- CustomMetaTagProperty
- Custom configured meta tags will be available.
Namespace
Drupal\custom_meta\Plugin\metatag\TagCode
public function output() {
$element = parent::output();
// Unset empty values.
if (!empty($element)) {
foreach ($element as $key => $item) {
if ($item['#attributes'] && empty($item['#attributes']['content'])) {
unset($element[$key]);
}
}
}
return $element;
}