Code Duplication    Length = 13-13 lines in 2 locations

modules/sharedaddy/sharing-service.php 1 location

@@ 311-323 (lines=13) @@
308
		$shows = array_values( get_post_types( array( 'public' => true ) ) );
309
		$shows[] = 'index';
310
		if ( isset( $data['show'] ) ) {
311
			if ( is_scalar( $data['show'] ) ) {
312
				switch ( $data['show'] ) {
313
				case 'posts' :
314
					$data['show'] = array( 'post', 'page' );
315
					break;
316
				case 'index' :
317
					$data['show'] = array( 'index' );
318
					break;
319
				case 'posts-index' :
320
					$data['show'] = array( 'post', 'page', 'index' );
321
					break;
322
				}
323
			}
324
325
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
326
				$options['global']['show'] = $data['show'];

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

@@ 618-630 (lines=13) @@
615
		$data = $_POST;
616
617
		if ( isset( $data['show'] ) ) {
618
			if ( is_scalar( $data['show'] ) ) {
619
				switch ( $data['show'] ) {
620
					case 'posts' :
621
						$data['show'] = array( 'post', 'page' );
622
						break;
623
					case 'index' :
624
						$data['show'] = array( 'index' );
625
						break;
626
					case 'posts-index' :
627
						$data['show'] = array( 'post', 'page', 'index' );
628
						break;
629
				}
630
			}
631
632
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
633
				$options['global']['show'] = $data['show'];