Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 618-630 (lines=13) @@
615
		$data = $_POST;
616
617
		if ( isset( $data['show'] ) ) {
618
			if ( is_scalar( $data['show'] ) ) {
619
				switch ( $data['show'] ) {
620
					case 'posts' :
621
						$data['show'] = array( 'post', 'page' );
622
						break;
623
					case 'index' :
624
						$data['show'] = array( 'index' );
625
						break;
626
					case 'posts-index' :
627
						$data['show'] = array( 'post', 'page', 'index' );
628
						break;
629
				}
630
			}
631
632
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
633
				$options['global']['show'] = $data['show'];

modules/sharedaddy/sharing-service.php 1 location

@@ 309-321 (lines=13) @@
306
		$shows = array_values( get_post_types( array( 'public' => true ) ) );
307
		$shows[] = 'index';
308
		if ( isset( $data['show'] ) ) {
309
			if ( is_scalar( $data['show'] ) ) {
310
				switch ( $data['show'] ) {
311
				case 'posts' :
312
					$data['show'] = array( 'post', 'page' );
313
					break;
314
				case 'index' :
315
					$data['show'] = array( 'index' );
316
					break;
317
				case 'posts-index' :
318
					$data['show'] = array( 'post', 'page', 'index' );
319
					break;
320
				}
321
			}
322
323
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
324
				$options['global']['show'] = $data['show'];