Code Duplication    Length = 14-15 lines in 2 locations

projects/plugins/jetpack/modules/search/class.jetpack-search.php 2 locations

@@ 1603-1616 (lines=14) @@
1600
1601
						// Let's determine if this term is active or not.
1602
1603
						if ( in_array( $item['key'], $existing_term_slugs, true ) ) {
1604
							$active = true;
1605
1606
							$slug_count = count( $existing_term_slugs );
1607
1608
							if ( $slug_count > 1 ) {
1609
								$remove_url = Jetpack_Search_Helpers::add_query_arg(
1610
									$tax_query_var,
1611
									rawurlencode( implode( '+', array_diff( $existing_term_slugs, array( $item['key'] ) ) ) )
1612
								);
1613
							} else {
1614
								$remove_url = Jetpack_Search_Helpers::remove_query_arg( $tax_query_var );
1615
							}
1616
						}
1617
1618
						break;
1619
@@ 1640-1654 (lines=15) @@
1637
							$post_types = array( $post_types );
1638
						}
1639
1640
						if ( in_array( $item['key'], $post_types, true ) ) {
1641
							$active = true;
1642
1643
							$post_type_count = count( $post_types );
1644
1645
							// For the right 'remove filter' url, we need to remove the post type from the array, or remove the param entirely if it's the only one.
1646
							if ( $post_type_count > 1 ) {
1647
								$remove_url = Jetpack_Search_Helpers::add_query_arg(
1648
									'post_type',
1649
									rawurlencode( implode( ',', array_diff( $post_types, array( $item['key'] ) ) ) )
1650
								);
1651
							} else {
1652
								$remove_url = Jetpack_Search_Helpers::remove_query_arg( 'post_type' );
1653
							}
1654
						}
1655
1656
						break;
1657