function adsense_get_client_slot_id in Google AdSense integration 7
Same name and namespace in other branches
- 5.3 adsense.module \adsense_get_client_slot_id()
- 6 adsense.module \adsense_get_client_slot_id()
Provides the Google AdSense Publisher ID / slot ID to be used in the ad.
If revenue sharing modules are installed, this function will call the appropriate function in those modules.
Parameters
string $format: Format of the ad being generated (optional).
Return value
mixed If the format parameter is supplied, array with 'client' and 'slot' fields, otherwise just the Publisher ID string is returned
4 calls to adsense_get_client_slot_id()
- adsense_adstxt_controller in adstxt/
adsense_adstxt.pages.inc - Generates the ads.txt page.
- adsense_display in ./
adsense.module - Generates the Google AdSense Ad.
- adsense_managed_init in managed/
adsense_managed.module - Implements hook_init().
- _adsense_csev2_results in cse/
adsense_csev2.results.inc - Creates the CSE v2 search results page for site-embedded search results.
File
- ./
adsense.module, line 326 - Displays Google AdSense ads on Drupal pages.
Code
function adsense_get_client_slot_id($format = NULL) {
// Get the configured function.
/** @var string $function */
$function = variable_get('adsense_id_module', ADSENSE_ID_MODULE_DEFAULT);
if ($function != ADSENSE_ID_MODULE_DEFAULT) {
// Call the function.
if (function_exists($function)) {
$client_id = $function('client_id', $format);
if ($client_id) {
return $client_id;
}
}
}
return variable_get('adsense_basic_id', ADSENSE_BASIC_ID_DEFAULT);
}