Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 707-719 (lines=13) @@
704
		$data = $_POST;
705
706
		if ( isset( $data['show'] ) ) {
707
			if ( is_scalar( $data['show'] ) ) {
708
				switch ( $data['show'] ) {
709
					case 'posts' :
710
						$data['show'] = array( 'post', 'page' );
711
						break;
712
					case 'index' :
713
						$data['show'] = array( 'index' );
714
						break;
715
					case 'posts-index' :
716
						$data['show'] = array( 'post', 'page', 'index' );
717
						break;
718
				}
719
			}
720
721
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
722
				$options['global']['show'] = $data['show'];

modules/sharedaddy/sharing-service.php 1 location

@@ 366-378 (lines=13) @@
363
		$shows   = array_values( get_post_types( array( 'public' => true ) ) );
364
		$shows[] = 'index';
365
		if ( isset( $data['show'] ) ) {
366
			if ( is_scalar( $data['show'] ) ) {
367
				switch ( $data['show'] ) {
368
					case 'posts':
369
						$data['show'] = array( 'post', 'page' );
370
						break;
371
					case 'index':
372
						$data['show'] = array( 'index' );
373
						break;
374
					case 'posts-index':
375
						$data['show'] = array( 'post', 'page', 'index' );
376
						break;
377
				}
378
			}
379
380
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
381
				$options['global']['show'] = $data['show'];