Code Duplication    Length = 22-23 lines in 2 locations

modules/wordads/wordads.php 2 locations

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