$taxonomy, 'hide_empty' => true, ); if ( ! empty( $facet['exclude_terms'] ) && is_array( $facet['exclude_terms'] ) ) { $term_args['exclude'] = array_values( array_filter( array_map( 'absint', $facet['exclude_terms'] ) ) ); } if ( ! empty( $facet['include_terms'] ) && is_array( $facet['include_terms'] ) ) { $term_args['include'] = array_values( array_filter( array_map( 'absint', $facet['include_terms'] ) ) ); } $terms = get_terms( $term_args ); if ( empty( $terms ) || is_wp_error( $terms ) ) { return ''; } $active_terms = ! empty( $runtime_params['facets'][ $taxonomy ] ) ? (array) $runtime_params['facets'][ $taxonomy ] : array(); $is_all_active = empty( $active_terms ) || in_array( 'all', $active_terms, true ) || in_array( 0, $active_terms, true ); $extra_classes = ''; if ( 'chips_scroll' === $style ) { $extra_classes = ' gm-facet-chips gm-chips-scroll'; } elseif ( 'chips' === $style ) { $extra_classes = ' gm-facet-chips'; } ob_start(); ?>