Code Duplication    Length = 13-13 lines in 2 locations

modules/likes.php 1 location

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

modules/sharedaddy/sharing-service.php 1 location

@@ 296-308 (lines=13) @@
293
		$shows = array_values( get_post_types( array( 'public' => true ) ) );
294
		$shows[] = 'index';
295
		if ( isset( $data['show'] ) ) {
296
			if ( is_scalar( $data['show'] ) ) {
297
				switch ( $data['show'] ) {
298
				case 'posts' :
299
					$data['show'] = array( 'post', 'page' );
300
					break;
301
				case 'index' :
302
					$data['show'] = array( 'index' );
303
					break;
304
				case 'posts-index' :
305
					$data['show'] = array( 'post', 'page', 'index' );
306
					break;
307
				}
308
			}
309
310
			if ( $data['show'] = array_intersect( $data['show'], $shows ) ) {
311
				$options['global']['show'] = $data['show'];