Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 629-641 (lines=13) @@
626
		$data = $_POST;
627
628
		if ( isset( $data['show'] ) ) {
629
			if ( is_scalar( $data['show'] ) ) {
630
				switch ( $data['show'] ) {
631
					case 'posts' :
632
						$data['show'] = array( 'post', 'page' );
633
						break;
634
					case 'index' :
635
						$data['show'] = array( 'index' );
636
						break;
637
					case 'posts-index' :
638
						$data['show'] = array( 'post', 'page', 'index' );
639
						break;
640
				}
641
			}
642
643
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
644
				$options['global']['show'] = $data['show'];

modules/sharedaddy/sharing-service.php 1 location

@@ 329-341 (lines=13) @@
326
		$shows = array_values( get_post_types( array( 'public' => true ) ) );
327
		$shows[] = 'index';
328
		if ( isset( $data['show'] ) ) {
329
			if ( is_scalar( $data['show'] ) ) {
330
				switch ( $data['show'] ) {
331
				case 'posts' :
332
					$data['show'] = array( 'post', 'page' );
333
					break;
334
				case 'index' :
335
					$data['show'] = array( 'index' );
336
					break;
337
				case 'posts-index' :
338
					$data['show'] = array( 'post', 'page', 'index' );
339
					break;
340
				}
341
			}
342
343
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
344
				$options['global']['show'] = $data['show'];