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