You are here

function adsense_oldcode_preprocess_block in Google AdSense integration 8

Implements hook_preprocess_block().

File

oldcode/adsense_oldcode.module, line 83
Displays Google AdSense ads on Drupal pages using the pre-2007 code.

Code

function adsense_oldcode_preprocess_block(&$variables) {

  // Remove adsense from the block id and classes to bypass adblock rules.
  if ($variables['configuration']['provider'] == 'adsense_oldcode' && \Drupal::config('adsense.settings')
    ->get('adsense_unblock_ads')) {
    $variables['plugin_id'] = str_replace('adsense', '', $variables['plugin_id']);
    $variables['configuration']['provider'] = '';
  }
}