You are here

function _menu_link_content_visibility_preprocess_superfish_item_cache_tags in Custom Menu Links Visibility 8

1 call to _menu_link_content_visibility_preprocess_superfish_item_cache_tags()
_menu_link_content_visibility_preprocess_superfish_items_cache_tags in ./menu_link_content_visibility.module

File

./menu_link_content_visibility.module, line 202

Code

function _menu_link_content_visibility_preprocess_superfish_item_cache_tags($item) {
  $original_link = $item->link;
  if ($original_link instanceof MenuLinkContent) {
    $entity_id = $original_link
      ->getMetaData()['entity_id'];
    return MenuLinkContentVisibilityCache::createFromID(Drupal::getContainer(), $entity_id)
      ->getCacheTags();
  }
  return [];
}