Code Duplication    Length = 13-13 lines in 2 locations

modules/sharedaddy/sharing-service.php 1 location

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

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