@@ 231-252 (lines=22) @@ | ||
228 | * |
|
229 | * @since 4.5.0 |
|
230 | */ |
|
231 | function insert_ad( $content ) { |
|
232 | // Ad JS won't work in XML feeds. |
|
233 | if ( is_feed() ) { |
|
234 | return $content; |
|
235 | } |
|
236 | /** |
|
237 | * Allow third-party tools to disable the display of in post ads. |
|
238 | * |
|
239 | * @module wordads |
|
240 | * |
|
241 | * @since 4.5.0 |
|
242 | * |
|
243 | * @param bool true Should the in post unit be disabled. Default to false. |
|
244 | */ |
|
245 | $disable = apply_filters( 'wordads_inpost_disable', false ); |
|
246 | if ( ! $this->params->should_show() || $disable ) { |
|
247 | return $content; |
|
248 | } |
|
249 | ||
250 | $ad_type = $this->option( 'wordads_house' ) ? 'house' : 'iponweb'; |
|
251 | return $content . $this->get_ad( 'belowpost', $ad_type ); |
|
252 | } |
|
253 | ||
254 | /** |
|
255 | * Insert an inline ad into a post content |
|
@@ 260-282 (lines=23) @@ | ||
257 | * |
|
258 | * @since 6.1.0 |
|
259 | */ |
|
260 | function insert_inline_ad( $content ) { |
|
261 | // Ad JS won't work in XML feeds. |
|
262 | if ( is_feed() ) { |
|
263 | return $content; |
|
264 | } |
|
265 | /** |
|
266 | * Allow third-party tools to disable the display of in post ads. |
|
267 | * |
|
268 | * @module wordads |
|
269 | * |
|
270 | * @since 4.5.0 |
|
271 | * |
|
272 | * @param bool true Should the in post unit be disabled. Default to false. |
|
273 | */ |
|
274 | $disable = apply_filters( 'wordads_inpost_disable', false ); |
|
275 | if ( $disable ) { |
|
276 | return $content; |
|
277 | } |
|
278 | ||
279 | $ad_type = $this->option( 'wordads_house' ) ? 'house' : 'iponweb'; |
|
280 | $content .= $this->get_ad( 'inline', $ad_type ); |
|
281 | return $content; |
|
282 | } |
|
283 | ||
284 | /** |
|
285 | * Inserts ad into header |