statistics_block_alter

statistics_block_alter(&$definitions)

Implements hook_block_alter().

Removes the "popular" block from display if the module is not configured to count content views.

File

core/modules/statistics/statistics.module, line 201
Logs and displays content statistics for a site.

Code

function statistics_block_alter(&$definitions) {
  $statistics_count_content_views = \Drupal::config('statistics.settings')->get('count_content_views');
  if (empty($statistics_count_content_views)) {
    unset($definitions['statistics_popular_block']);
  }
}
doc_Drupal
2016-10-29 09:44:26
Comments
Leave a Comment

Please login to continue.