Code Duplication    Length = 13-13 lines in 2 locations

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

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

modules/sharedaddy/sharing-service.php 1 location

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