Code Duplication    Length = 21-22 lines in 2 locations

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

@@ 627-647 (lines=21) @@
624
							break;
625
						}
626
					break;
627
					case 'tag':
628
						// All tag pages.
629
						if( ! $rule['minor'] ) {
630
							if ( is_tag() ) {
631
								$condition_result = true;
632
							} else if ( is_singular() ) {
633
								if( in_array( 'post_tag', get_post_taxonomies() ) ) {
634
									$condition_result = true;
635
								}
636
							}
637
							break;
638
						}
639
640
						// All pages with the specified tag term.
641
						if ( is_tag( $rule['minor'] ) ) {
642
							$condition_result = true;
643
						}
644
						else if ( is_singular() && has_term( $rule['minor'], 'post_tag' ) ) {
645
							$condition_result = true;
646
						}
647
					break;
648
					case 'category':
649
						// All category pages.
650
						if( ! $rule['minor'] ) {
@@ 648-669 (lines=22) @@
645
							$condition_result = true;
646
						}
647
					break;
648
					case 'category':
649
						// All category pages.
650
						if( ! $rule['minor'] ) {
651
							if ( is_category() ) {
652
								$condition_result = true;
653
							}
654
							else if ( is_singular() ) {
655
								if( in_array( 'category', get_post_taxonomies() ) ) {
656
									$condition_result = true;
657
								}
658
							}
659
							break;
660
						}
661
662
						// All pages with the specified category term.
663
						if ( is_category( $rule['minor'] ) ) {
664
							$condition_result = true;
665
						}
666
						else if ( is_singular() && has_term( $rule['minor'], 'category' ) ) {
667
							$condition_result = true;
668
						}
669
					break;
670
					case 'loggedin':
671
						$condition_result = is_user_logged_in();
672
						if ( 'loggedin' !== $rule['minor'] ) {