| @@ 254-275 (lines=22) @@ | ||
| 251 | * |
|
| 252 | * @since 4.5.0 |
|
| 253 | */ |
|
| 254 | function insert_ad( $content ) { |
|
| 255 | // Ad JS won't work in XML feeds. |
|
| 256 | if ( is_feed() ) { |
|
| 257 | return $content; |
|
| 258 | } |
|
| 259 | /** |
|
| 260 | * Allow third-party tools to disable the display of in post ads. |
|
| 261 | * |
|
| 262 | * @module wordads |
|
| 263 | * |
|
| 264 | * @since 4.5.0 |
|
| 265 | * |
|
| 266 | * @param bool true Should the in post unit be disabled. Default to false. |
|
| 267 | */ |
|
| 268 | $disable = apply_filters( 'wordads_inpost_disable', false ); |
|
| 269 | if ( ! $this->params->should_show() || $disable ) { |
|
| 270 | return $content; |
|
| 271 | } |
|
| 272 | ||
| 273 | $ad_type = $this->option( 'wordads_house' ) ? 'house' : 'iponweb'; |
|
| 274 | return $content . $this->get_ad( 'belowpost', $ad_type ); |
|
| 275 | } |
|
| 276 | ||
| 277 | /** |
|
| 278 | * Insert an inline ad into a post content |
|
| @@ 283-305 (lines=23) @@ | ||
| 280 | * |
|
| 281 | * @since 6.1.0 |
|
| 282 | */ |
|
| 283 | function insert_inline_ad( $content ) { |
|
| 284 | // Ad JS won't work in XML feeds. |
|
| 285 | if ( is_feed() ) { |
|
| 286 | return $content; |
|
| 287 | } |
|
| 288 | /** |
|
| 289 | * Allow third-party tools to disable the display of in post ads. |
|
| 290 | * |
|
| 291 | * @module wordads |
|
| 292 | * |
|
| 293 | * @since 4.5.0 |
|
| 294 | * |
|
| 295 | * @param bool true Should the in post unit be disabled. Default to false. |
|
| 296 | */ |
|
| 297 | $disable = apply_filters( 'wordads_inpost_disable', false ); |
|
| 298 | if ( $disable ) { |
|
| 299 | return $content; |
|
| 300 | } |
|
| 301 | ||
| 302 | $ad_type = $this->option( 'wordads_house' ) ? 'house' : 'iponweb'; |
|
| 303 | $content .= $this->get_ad( 'inline', $ad_type ); |
|
| 304 | return $content; |
|
| 305 | } |
|
| 306 | ||
| 307 | /** |
|
| 308 | * Inserts ad into header |
|