Code Duplication    Length = 13-13 lines in 2 locations

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'];

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

@@ 691-703 (lines=13) @@
688
		$data = $_POST;
689
690
		if ( isset( $data['show'] ) ) {
691
			if ( is_scalar( $data['show'] ) ) {
692
				switch ( $data['show'] ) {
693
					case 'posts' :
694
						$data['show'] = array( 'post', 'page' );
695
						break;
696
					case 'index' :
697
						$data['show'] = array( 'index' );
698
						break;
699
					case 'posts-index' :
700
						$data['show'] = array( 'post', 'page', 'index' );
701
						break;
702
				}
703
			}
704
705
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
706
				$options['global']['show'] = $data['show'];