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

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