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

@@ 451-463 (lines=13) @@
448
		$data = $_POST;
449
450
		if ( isset( $data['show'] ) ) {
451
			if ( is_scalar( $data['show'] ) ) {
452
				switch ( $data['show'] ) {
453
					case 'posts' :
454
						$data['show'] = array( 'post', 'page' );
455
					break;
456
					case 'index' :
457
						$data['show'] = array( 'index' );
458
					break;
459
					case 'posts-index' :
460
						$data['show'] = array( 'post', 'page', 'index' );
461
					break;
462
				}
463
			}
464
465
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
466
				$options['global']['show'] = $data['show'];