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']); } }
Please login to continue.