Code Duplication    Length = 13-13 lines in 2 locations

modules/likes/jetpack-likes-settings.php 1 location

@@ 644-656 (lines=13) @@
641
		$data = $_POST;
642
643
		if ( isset( $data['show'] ) ) {
644
			if ( is_scalar( $data['show'] ) ) {
645
				switch ( $data['show'] ) {
646
					case 'posts' :
647
						$data['show'] = array( 'post', 'page' );
648
						break;
649
					case 'index' :
650
						$data['show'] = array( 'index' );
651
						break;
652
					case 'posts-index' :
653
						$data['show'] = array( 'post', 'page', 'index' );
654
						break;
655
				}
656
			}
657
658
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
659
				$options['global']['show'] = $data['show'];

modules/sharedaddy/sharing-service.php 1 location

@@ 355-367 (lines=13) @@
352
		$shows   = array_values( get_post_types( array( 'public' => true ) ) );
353
		$shows[] = 'index';
354
		if ( isset( $data['show'] ) ) {
355
			if ( is_scalar( $data['show'] ) ) {
356
				switch ( $data['show'] ) {
357
					case 'posts':
358
						$data['show'] = array( 'post', 'page' );
359
						break;
360
					case 'index':
361
						$data['show'] = array( 'index' );
362
						break;
363
					case 'posts-index':
364
						$data['show'] = array( 'post', 'page', 'index' );
365
						break;
366
				}
367
			}
368
369
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
370
				$options['global']['show'] = $data['show'];