Code Duplication    Length = 21-22 lines in 2 locations

modules/widget-visibility/widget-conditions.php 2 locations

@@ 508-528 (lines=21) @@
505
							break;
506
						}
507
					break;
508
					case 'tag':
509
						// All tag pages.
510
						if( ! $rule['minor'] ) {
511
							if ( is_tag() ) {
512
								$condition_result = true;
513
							} else if ( is_singular() ) {
514
								if( in_array( 'post_tag', get_post_taxonomies() ) ) {
515
									$condition_result = true;
516
								}
517
							}
518
							break;
519
						}
520
521
						// All pages with the specified tag term.
522
						if ( is_tag( $rule['minor'] ) ) {
523
							$condition_result = true;
524
						}
525
						else if ( is_singular() && has_term( $rule['minor'], 'post_tag' ) ) {
526
							$condition_result = true;
527
						}
528
					break;
529
					case 'category':
530
						// All category pages.
531
						if( ! $rule['minor'] ) {
@@ 529-550 (lines=22) @@
526
							$condition_result = true;
527
						}
528
					break;
529
					case 'category':
530
						// All category pages.
531
						if( ! $rule['minor'] ) {
532
							if ( is_category() ) {
533
								$condition_result = true;
534
							}
535
							else if ( is_singular() ) {
536
								if( in_array( 'category', get_post_taxonomies() ) ) {
537
									$condition_result = true;
538
								}
539
							}
540
							break;
541
						}
542
543
						// All pages with the specified category term.
544
						if ( is_category( $rule['minor'] ) ) {
545
							$condition_result = true;
546
						}
547
						else if ( is_singular() && has_term( $rule['minor'], 'category' ) ) {
548
							$condition_result = true;
549
						}
550
					break;
551
					case 'loggedin':
552
						$condition_result = is_user_logged_in();
553
						if ( 'loggedin' !== $rule['minor'] ) {