Code Duplication    Length = 13-18 lines in 2 locations

modules/likes.php 2 locations

@@ 1241-1258 (lines=18) @@
1238
	 * @param String $post_type custom post type identifier
1239
	 * @return bool
1240
	 */
1241
	function is_single_post_enabled( $post_type = 'post' ) {
1242
		$options = $this->get_options();
1243
		return (bool) apply_filters(
1244
			/**
1245
			 * Filters whether Likes should be enabled on single posts.
1246
			 *
1247
			 * The dynamic part of the filter, {$post_type}, allows you to specific the post type where Likes should be enabled.
1248
			 *
1249
			 * @module likes
1250
			 *
1251
			 * @since 2.2.0
1252
			 *
1253
			 * @param bool $enabled Are Post Likes enabled on single posts?
1254
			 */
1255
			"wpl_is_single_{$post_type}_disabled",
1256
			(bool) in_array( $post_type, $options['show'] )
1257
		);
1258
	}
1259
1260
	/**
1261
	 * Are Post Likes enabled on single pages?
@@ 1265-1277 (lines=13) @@
1262
	 *
1263
	 * @return bool
1264
	 */
1265
	function is_single_page_enabled() {
1266
		$options = $this->get_options();
1267
		/**
1268
		 * Filters whether Likes should be enabled on single pages.
1269
		 *
1270
		 * @module likes
1271
		 *
1272
		 * @since 2.2.0
1273
		 *
1274
		 * @param bool $enabled Are Post Likes enabled on single pages?
1275
		 */
1276
		return (bool) apply_filters( 'wpl_is_single_page_disabled', (bool) in_array( 'page', $options['show'] ) );
1277
	}
1278
1279
	/**
1280
	 * Are Media Likes enabled on single pages?