Code Duplication    Length = 11-16 lines in 2 locations

modules/search/class.jetpack-search.php 1 location

@@ 1024-1039 (lines=16) @@
1021
				$terms = (array) $terms;
1022
1023
				if ( count( $terms ) && mb_strlen( $tax ) ) {
1024
					switch ( $tax ) {
1025
						case 'post_tag':
1026
							$tax_fld = 'tag.slug';
1027
1028
							break;
1029
1030
						case 'category':
1031
							$tax_fld = 'category.slug';
1032
1033
							break;
1034
1035
						default:
1036
							$tax_fld = 'taxonomy.' . $tax . '.slug';
1037
1038
							break;
1039
					}
1040
1041
					foreach ( $terms as $term ) {
1042
						$parser->add_filter( array(

modules/related-posts/jetpack-related-posts.php 1 location

@@ 681-691 (lines=11) @@
678
		if ( ! empty( $args['has_terms'] ) ) {
679
			foreach( (array)$args['has_terms'] as $term ) {
680
				if ( mb_strlen( $term->taxonomy ) ) {
681
					switch ( $term->taxonomy ) {
682
						case 'post_tag':
683
							$tax_fld = 'tag.slug';
684
							break;
685
						case 'category':
686
							$tax_fld = 'category.slug';
687
							break;
688
						default:
689
							$tax_fld = 'taxonomy.' . $term->taxonomy . '.slug';
690
							break;
691
					}
692
					$filters[] = array( 'term' => array( $tax_fld => $term->slug ) );
693
				}
694
			}