Code Duplication    Length = 11-16 lines in 2 locations

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

@@ 882-892 (lines=11) @@
879
		if ( ! empty( $args['has_terms'] ) ) {
880
			foreach( (array)$args['has_terms'] as $term ) {
881
				if ( mb_strlen( $term->taxonomy ) ) {
882
					switch ( $term->taxonomy ) {
883
						case 'post_tag':
884
							$tax_fld = 'tag.slug';
885
							break;
886
						case 'category':
887
							$tax_fld = 'category.slug';
888
							break;
889
						default:
890
							$tax_fld = 'taxonomy.' . $term->taxonomy . '.slug';
891
							break;
892
					}
893
					$filters[] = array( 'term' => array( $tax_fld => $term->slug ) );
894
				}
895
			}

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

@@ 1164-1179 (lines=16) @@
1161
				$terms = (array) $terms;
1162
1163
				if ( count( $terms ) && mb_strlen( $tax ) ) {
1164
					switch ( $tax ) {
1165
						case 'post_tag':
1166
							$tax_fld = 'tag.slug';
1167
1168
							break;
1169
1170
						case 'category':
1171
							$tax_fld = 'category.slug';
1172
1173
							break;
1174
1175
						default:
1176
							$tax_fld = 'taxonomy.' . $tax . '.slug';
1177
1178
							break;
1179
					}
1180
1181
					foreach ( $terms as $term ) {
1182
						$parser->add_filter(