1 | <?php |
||
13 | class WordAds { |
||
14 | |||
15 | public $params = null; |
||
16 | |||
17 | /** |
||
18 | * The different supported ad types. |
||
19 | * v0.1 - mrec only for now |
||
20 | * @var array |
||
21 | */ |
||
22 | public static $ad_tag_ids = array( |
||
23 | 'mrec' => array( |
||
24 | 'tag' => '300x250_mediumrectangle', |
||
25 | 'height' => '250', |
||
26 | 'width' => '300', |
||
27 | ), |
||
28 | 'lrec' => array( |
||
29 | 'tag' => '336x280_largerectangle', |
||
30 | 'height' => '280', |
||
31 | 'width' => '336', |
||
32 | ), |
||
33 | 'leaderboard' => array( |
||
34 | 'tag' => '728x90_leaderboard', |
||
35 | 'height' => '90', |
||
36 | 'width' => '728', |
||
37 | ), |
||
38 | 'wideskyscraper' => array( |
||
39 | 'tag' => '160x600_wideskyscraper', |
||
40 | 'height' => '600', |
||
41 | 'width' => '160', |
||
42 | ), |
||
43 | ); |
||
44 | |||
45 | /** |
||
46 | * Convenience function for grabbing options from params->options |
||
47 | * @param string $option the option to grab |
||
48 | * @param mixed $default (optional) |
||
49 | * @return option or $default if not set |
||
50 | * |
||
51 | * @since 4.5.0 |
||
52 | */ |
||
53 | function option( $option, $default = false ) { |
||
60 | |||
61 | /** |
||
62 | * Instantiate the plugin |
||
63 | * |
||
64 | * @since 4.5.0 |
||
65 | */ |
||
66 | function __construct() { |
||
69 | |||
70 | /** |
||
71 | * Code to run on WordPress 'init' hook |
||
72 | * |
||
73 | * @since 4.5.0 |
||
74 | */ |
||
75 | function init() { |
||
96 | |||
97 | /** |
||
98 | * Check for Jetpack's The_Neverending_Home_Page and use got_infinity |
||
99 | * @return boolean true if load came from infinite scroll |
||
100 | * |
||
101 | * @since 4.5.0 |
||
102 | */ |
||
103 | public static function is_infinite_scroll() { |
||
108 | |||
109 | /** |
||
110 | * Add the actions/filters to insert the ads. Checks for mobile or desktop. |
||
111 | * |
||
112 | * @since 4.5.0 |
||
113 | */ |
||
114 | private function insert_adcode() { |
||
125 | |||
126 | /** |
||
127 | * Add the actions/filters to insert extra-network features. |
||
128 | * |
||
129 | * @since 4.5.0 |
||
130 | */ |
||
131 | private function insert_extras() { |
||
134 | |||
135 | /** |
||
136 | * Register desktop scripts and styles |
||
137 | * |
||
138 | * @since 4.5.0 |
||
139 | */ |
||
140 | function enqueue_scripts() { |
||
148 | |||
149 | /** |
||
150 | * IPONWEB metadata used by the various scripts |
||
151 | * @return [type] [description] |
||
|
|||
152 | */ |
||
153 | function insert_head_meta() { |
||
169 | |||
170 | /** |
||
171 | * IPONWEB scripts in <head> |
||
172 | * |
||
173 | * @since 4.5.0 |
||
174 | */ |
||
175 | function insert_head_iponweb() { |
||
179 | |||
180 | /** |
||
181 | * Insert the ad onto the page |
||
182 | * |
||
183 | * @since 4.5.0 |
||
184 | */ |
||
185 | function insert_ad( $content ) { |
||
203 | |||
204 | /** |
||
205 | * Inserts ad into header |
||
206 | * |
||
207 | * @since 4.5.0 |
||
208 | */ |
||
209 | function insert_header_ad() { |
||
226 | |||
227 | /** |
||
228 | * Get the ad for the spot and type. |
||
229 | * @param string $spot top, side, or belowpost |
||
230 | * @param string $type iponweb or adsense |
||
231 | */ |
||
232 | function get_ad( $spot, $type = 'iponweb' ) { |
||
285 | |||
286 | /** |
||
287 | * Check the reasons to bail before we attempt to insert ads. |
||
288 | * @return true if we should bail (don't insert ads) |
||
289 | * |
||
290 | * @since 4.5.0 |
||
291 | */ |
||
292 | public function should_bail() { |
||
295 | |||
296 | /** |
||
297 | * Activation hook actions |
||
298 | * |
||
299 | * @since 4.5.0 |
||
300 | */ |
||
301 | public static function activate() { |
||
304 | } |
||
305 | |||
312 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.