Code Duplication    Length = 13-13 lines in 2 locations

modules/sharedaddy/sharing-service.php 1 location

@@ 287-299 (lines=13) @@
284
		$shows = array_values( get_post_types( array( 'public' => true ) ) );
285
		$shows[] = 'index';
286
		if ( isset( $data['show'] ) ) {
287
			if ( is_scalar( $data['show'] ) ) {
288
				switch ( $data['show'] ) {
289
				case 'posts' :
290
					$data['show'] = array( 'post', 'page' );
291
					break;
292
				case 'index' :
293
					$data['show'] = array( 'index' );
294
					break;
295
				case 'posts-index' :
296
					$data['show'] = array( 'post', 'page', 'index' );
297
					break;
298
				}
299
			}
300
301
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
302
				$options['global']['show'] = $data['show'];

modules/likes.php 1 location

@@ 464-476 (lines=13) @@
461
		$data = $_POST;
462
463
		if ( isset( $data['show'] ) ) {
464
			if ( is_scalar( $data['show'] ) ) {
465
				switch ( $data['show'] ) {
466
					case 'posts' :
467
						$data['show'] = array( 'post', 'page' );
468
					break;
469
					case 'index' :
470
						$data['show'] = array( 'index' );
471
					break;
472
					case 'posts-index' :
473
						$data['show'] = array( 'post', 'page', 'index' );
474
					break;
475
				}
476
			}
477
478
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
479
				$options['global']['show'] = $data['show'];