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

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