You are here

function _d8cache_block_get_cache_tags in Drupal 8 Cache Backport 7

Get cache tags for block.

2 calls to _d8cache_block_get_cache_tags()
d8cache_block_view_alter in includes/block.inc
Implements hook_block_view_alter().
_d8cache_block_admin_configure_submit in includes/block.inc
Submit handler for block_admin_configure form.

File

includes/block.inc, line 80
Block functions and hooks for the D8 caching system backport.

Code

function _d8cache_block_get_cache_tags($block) {
  $tags = array();
  $tags[] = 'block:' . $block->module . '.' . str_replace('-', '_', drupal_html_class($block->delta));

  // Allow blocks to set cache tags.
  if (!empty($block->drupal_cache_tags)) {
    $tags = array_merge($tags, $block->drupal_cache_tags);
  }
  return $tags;
}