11# Developer API
22
3- A ` global $DoubleClick ` variable is defined on plugin init, making it possible to define breakpoints
3+ A ` global $doubleclick ` variable is defined on plugin init, making it possible to define breakpoints
44and place ads directly within your theme.
55
66__ Quick Function Links:__
77
8- * [ $DoubleClick ->register_breakpoint($identifer ,$args)] ( #doubleclick-register_breakpointidentiferargs )
9- * [ $DoubleClick ->place_ad($identifer ,$size,$breakpoints)] ( #doubleclick-place_adidentifersizebreakpoints )
8+ * [ $doubleclick ->register_breakpoint($identifier ,$args)] ( #doubleclick-register_breakpointidentifierargs )
9+ * [ $doubleclick ->place_ad($identifier ,$size,$breakpoints)] ( #doubleclick-place_adidentifiersizebreakpoints )
1010
1111* * *
1212
1313## 1. Define Breakpoints
1414
15- ##### $DoubleClick ->register_breakpoint($identifer ,$args)
15+ ##### $doubleclick ->register_breakpoint($identifier ,$args)
1616
1717You can make it easier for users to target breakpoints by defining them in ` functions.php `
1818
@@ -21,24 +21,24 @@ You can make it easier for users to target breakpoints by defining them in `func
2121``` php
2222function ad_setup() {
2323
24- global $DoubleClick ;
24+ global $doubleclick ;
2525
2626 // Optionally define the network code directly in functions.php.
27- // $DoubleClick->networkCode = "xxxxxxx";
27+ // $doubleclick->network_code = "xxxxxxx";
2828
2929 /* Define Breakpoints */
30- $DoubleClick ->register_breakpoint('phone', array('minWidth '=> 0,'maxWidth '=>720));
31- $DoubleClick ->register_breakpoint('tablet', array('minWidth '=>760,'maxWidth '=>1040));
32- $DoubleClick ->register_breakpoint('desktop', array('minWidth '=>1040,'maxWidth '=>1220));
33- $DoubleClick ->register_breakpoint('xl', array('minWidth '=>1220,'maxWidth '=>9999));
30+ $doubleclick ->register_breakpoint('phone', array('min_width '=> 0,'max_width '=>720));
31+ $doubleclick ->register_breakpoint('tablet', array('min_width '=>760,'max_width '=>1040));
32+ $doubleclick ->register_breakpoint('desktop', array('min_width '=>1040,'max_width '=>1220));
33+ $doubleclick ->register_breakpoint('xl', array('min_width '=>1220,'max_width '=>9999));
3434
3535}
3636add_action('dfw_setup','ad_setup');
3737```
3838
3939##### Paramaters:
4040
41- __ $identifer __
41+ __ $identifier __
4242
4343` String ` A unique identifier for this breakpoint
4444
@@ -50,18 +50,18 @@ __$args__
5050
5151## 2. Place Ads
5252
53- ### $DoubleClick ->place_ad($identifer ,$sizes,$args)
53+ ### $doubleclick ->place_ad($identifier ,$sizes,$args)
5454
5555Prints DOM to display an ad at the given breakpoint.
5656
5757##### Example:
5858
5959``` php
6060
61- global $DoubleClick ;
61+ global $doubleclick ;
6262
6363// simple call:
64- $DoubleClick ->place_ad('my-identifer ','300x250');
64+ $doubleclick ->place_ad('my-identifier ','300x250');
6565
6666// more options:
6767$sizes = array(
@@ -73,13 +73,13 @@ $args = array(
7373 'lazyLoad' => false // if set to true, the ad will load only once its within view on screen.
7474 );
7575
76- $DoubleClick ->place_ad('my-identifier',$sizes,$args);
76+ $doubleclick ->place_ad('my-identifier',$sizes,$args);
7777```
7878
7979
8080##### Paramaters:
8181
82- __ $identifer __
82+ __ $identifier __
8383
8484` String ` The Google Ad Manager identifier for an ad unit (GAM does not require you to create an identifier. If this does not match a value defined in GAM, a network-wide ad will still be requested).
8585
0 commit comments