Code Duplication    Length = 13-18 lines in 2 locations

modules/likes/jetpack-likes-settings.php 2 locations

@@ 364-381 (lines=18) @@
361
	 * @param String $post_type custom post type identifier
362
	 * @return bool
363
	 */
364
	function is_single_post_enabled( $post_type = 'post' ) {
365
		$options = $this->get_options();
366
		return (bool) apply_filters(
367
		/**
368
		 * Filters whether Likes should be enabled on single posts.
369
		 *
370
		 * The dynamic part of the filter, {$post_type}, allows you to specific the post type where Likes should be enabled.
371
		 *
372
		 * @module likes
373
		 *
374
		 * @since 2.2.0
375
		 *
376
		 * @param bool $enabled Are Post Likes enabled on single posts?
377
		 */
378
			"wpl_is_single_{$post_type}_disabled",
379
			(bool) in_array( $post_type, $options['show'] )
380
		);
381
	}
382
383
	/**
384
	 * Get the 'disabled_likes' option from the DB of the current blog.
@@ 451-463 (lines=13) @@
448
	 *
449
	 * @return bool
450
	 */
451
	function is_single_page_enabled() {
452
		$options = $this->get_options();
453
		/**
454
		 * Filters whether Likes should be enabled on single pages.
455
		 *
456
		 * @module likes
457
		 *
458
		 * @since 2.2.0
459
		 *
460
		 * @param bool $enabled Are Post Likes enabled on single pages?
461
		 */
462
		return (bool) apply_filters( 'wpl_is_single_page_disabled', (bool) in_array( 'page', $options['show'] ) );
463
	}
464
465
	/**
466
	 * Are Media Likes enabled on single pages?