Code Duplication    Length = 13-13 lines in 2 locations

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

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

@@ 644-656 (lines=13) @@
641
		$data = $_POST;
642
643
		if ( isset( $data['show'] ) ) {
644
			if ( is_scalar( $data['show'] ) ) {
645
				switch ( $data['show'] ) {
646
					case 'posts' :
647
						$data['show'] = array( 'post', 'page' );
648
						break;
649
					case 'index' :
650
						$data['show'] = array( 'index' );
651
						break;
652
					case 'posts-index' :
653
						$data['show'] = array( 'post', 'page', 'index' );
654
						break;
655
				}
656
			}
657
658
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
659
				$options['global']['show'] = $data['show'];