Code Duplication    Length = 13-13 lines in 2 locations

modules/sharedaddy/sharing-service.php 1 location

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

modules/likes.php 1 location

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