Code Duplication    Length = 22-23 lines in 2 locations

modules/wordads/wordads.php 2 locations

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