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

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