|
@@ 1634-1647 (lines=14) @@
|
| 1631 |
|
|
| 1632 |
|
// Let's determine if this term is active or not. |
| 1633 |
|
|
| 1634 |
|
if ( in_array( $item['key'], $existing_term_slugs, true ) ) { |
| 1635 |
|
$active = true; |
| 1636 |
|
|
| 1637 |
|
$slug_count = count( $existing_term_slugs ); |
| 1638 |
|
|
| 1639 |
|
if ( $slug_count > 1 ) { |
| 1640 |
|
$remove_url = Jetpack_Search_Helpers::add_query_arg( |
| 1641 |
|
$tax_query_var, |
| 1642 |
|
rawurlencode( implode( '+', array_diff( $existing_term_slugs, array( $item['key'] ) ) ) ) |
| 1643 |
|
); |
| 1644 |
|
} else { |
| 1645 |
|
$remove_url = Jetpack_Search_Helpers::remove_query_arg( $tax_query_var ); |
| 1646 |
|
} |
| 1647 |
|
} |
| 1648 |
|
|
| 1649 |
|
break; |
| 1650 |
|
|
|
@@ 1671-1685 (lines=15) @@
|
| 1668 |
|
$post_types = array( $post_types ); |
| 1669 |
|
} |
| 1670 |
|
|
| 1671 |
|
if ( in_array( $item['key'], $post_types, true ) ) { |
| 1672 |
|
$active = true; |
| 1673 |
|
|
| 1674 |
|
$post_type_count = count( $post_types ); |
| 1675 |
|
|
| 1676 |
|
// 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. |
| 1677 |
|
if ( $post_type_count > 1 ) { |
| 1678 |
|
$remove_url = Jetpack_Search_Helpers::add_query_arg( |
| 1679 |
|
'post_type', |
| 1680 |
|
rawurlencode( implode( ',', array_diff( $post_types, array( $item['key'] ) ) ) ) |
| 1681 |
|
); |
| 1682 |
|
} else { |
| 1683 |
|
$remove_url = Jetpack_Search_Helpers::remove_query_arg( 'post_type' ); |
| 1684 |
|
} |
| 1685 |
|
} |
| 1686 |
|
|
| 1687 |
|
break; |
| 1688 |
|
|