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

@@ 457-469 (lines=13) @@
454
		$data = $_POST;
455
456
		if ( isset( $data['show'] ) ) {
457
			if ( is_scalar( $data['show'] ) ) {
458
				switch ( $data['show'] ) {
459
					case 'posts' :
460
						$data['show'] = array( 'post', 'page' );
461
					break;
462
					case 'index' :
463
						$data['show'] = array( 'index' );
464
					break;
465
					case 'posts-index' :
466
						$data['show'] = array( 'post', 'page', 'index' );
467
					break;
468
				}
469
			}
470
471
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
472
				$options['global']['show'] = $data['show'];