Code Duplication    Length = 10-10 lines in 2 locations

json-endpoints/class.wpcom-json-api-post-endpoint.php 1 location

@@ 291-300 (lines=10) @@
288
			case 'pings_open' :
289
				$response[$key] = (bool) pings_open( $post->ID );
290
				break;
291
			case 'likes_enabled' :
292
				/** This filter is documented in modules/likes.php */
293
				$sitewide_likes_enabled = (bool) apply_filters( 'wpl_is_enabled_sitewide', ! get_option( 'disabled_likes' ) );
294
				$post_likes_switched    = (bool) get_post_meta( $post->ID, 'switch_like_status', true );
295
				$post_likes_enabled = $sitewide_likes_enabled;
296
				if ( $post_likes_switched ) {
297
					$post_likes_enabled = ! $post_likes_enabled;
298
				}
299
				$response[$key] = (bool) $post_likes_enabled;
300
				break;
301
			case 'sharing_enabled' :
302
				$show = true;
303
				/** This filter is documented in modules/sharedaddy/sharing-service.php */

json-endpoints/class.wpcom-json-api-post-v1-1-endpoint.php 1 location

@@ 278-287 (lines=10) @@
275
					'comment_count'  => (int) $post->comment_count,
276
				);
277
				break;
278
			case 'likes_enabled' :
279
				/** This filter is documented in modules/likes.php */
280
				$sitewide_likes_enabled = (bool) apply_filters( 'wpl_is_enabled_sitewide', ! get_option( 'disabled_likes' ) );
281
				$post_likes_switched    = (bool) get_post_meta( $post->ID, 'switch_like_status', true );
282
				$post_likes_enabled = $sitewide_likes_enabled;
283
				if ( $post_likes_switched ) {
284
					$post_likes_enabled = ! $post_likes_enabled;
285
				}
286
				$response[$key] = (bool) $post_likes_enabled;
287
				break;
288
			case 'sharing_enabled' :
289
				$show = true;
290
				/** This filter is documented in modules/sharedaddy/sharing-service.php */