forked from chapter-three/dfp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dfp.api.php
56 lines (50 loc) · 1.16 KB
/
dfp.api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* @file
* Hooks provided by the DFP module.
*
* This file is divided into static hooks (hooks with string literal names) and
* dynamic hooks (hooks with pattern-derived string names).
*/
/**
* @addtogroup hooks
* @{
*/
/**
* Alter a targeting key|value pair from a DFP tag.
*
* @param array $targeting
* The DFP tag's targeting key|value pair.
*/
function hook_dfp_target_alter(&$targeting) {
// @todo Add example.
}
/**
* Alter the global targeting key|value pairs.
*
* @param array $targeting
* The global targeting key|value pairs.
*/
function hook_dfp_global_targeting_alter(&$targeting) {
// @todo Fix example to be Drupal 8 relevant.
// The following example adds the URL arguments array to the targeting.
$arg = arg();
if (!empty($arg)) {
$targeting[] = [
'target' => 'arg',
'value' => $arg,
];
}
}
/**
* Alters the key values array used during the construction of a short tag.
*
* @param array $key_values
* The key values array used during the construction of a short tag.
*/
function hook_dfp_short_tag_keyvals_alter(&$key_values) {
// @todo Add example.
}
/**
* @} End of "addtogroup hooks".
*/