You are here

public function CustomMetaTagHttpEquiv::output in Custom Meta 2.0.x

File

src/Plugin/metatag/Tag/CustomMetaTagHttpEquiv.php, line 30

Class

CustomMetaTagHttpEquiv
Custom configured meta tags will be available.

Namespace

Drupal\custom_meta\Plugin\metatag\Tag

Code

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;
}