Code Duplication    Length = 13-13 lines in 2 locations

modules/likes.php 1 location

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

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