Code Duplication    Length = 13-13 lines in 2 locations

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

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