PluginProbe
Filter Everything — WordPress & WooCommerce Filters / 1.9.7
Filter Everything — WordPress & WooCommerce Filters v1.9.7
1.9.7 1.9.6 1.9.5 1.9.4 1.9.3 1.9.2.2 1.9.2.1 trunk 1.2.1 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.4.1 1.4.4 1.4.5 1.4.8 1.4.9 1.5.0 1.5.1 1.6.0 1.6.1 1.6.2 All 52 releases
filter-everything / views / frontend / chips.php

chips.php in Filter Everything — WordPress & WooCommerce Filters 1.9.7, at views/frontend/chips.php

47 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The Template for displaying filter selected terms.
4 *
5 * This template can be overridden by copying it to yourtheme/filters/chips.php.
6 *
7 * $chips - array, with the Filter Set parameters
8 *
9 * @see https://filtereverything.pro/resources/templates-overriding/
10 */
11
12 if ( ! defined('ABSPATH') ) {
13 exit;
14 }
15 // Unique index of this chips list on the page
16 $chips_count = \FilterEverything\Filter\Container::instance()->getFilterContext()->nextChipsIndex();
17 $selected_and_above_status = (isset($filter['selected_and_above']) && $filter['selected_and_above'] === 'yes') ? true : false;
18 ?>
19 <ul class="wpc-filter-chips-list wpc-filter-chips-<?php echo esc_attr( $setid .'-' .$chips_count ); ?> wpc-filter-chips-<?php echo esc_attr( $setid ); ?><?php if( ! $chips ){echo ' wpc-empty-chips-container';} ?>" data-set="<?php echo esc_attr( $setid ); ?>" data-setcount="<?php echo $setid .'-' .$chips_count ; ?>">
20 <?php if( $chips ) : ?>
21 <?php foreach( $chips as $chip ): ?>
22 <?php
23 // Smart spans: a chip whose removal target is not indexable must
24 // not expose a crawlable link (missing 'crawlable' means a link)
25 $chip_is_link = ! isset( $chip['crawlable'] ) || $chip['crawlable'];
26 $chip_tag = $chip_is_link ? 'a' : 'span';
27 $chip_link_att = $chip_is_link ? 'href' : 'data-wpc-span-link';
28 ?>
29 <li class="wpc-filter-chip <?php echo esc_attr( $chip['class'] ); ?>">
30 <<?php echo $chip_tag; ?> <?php echo $chip_link_att; ?>="<?php echo esc_url( $chip['link'] ); ?>" <?php echo (!empty($chip['link_class'])) ? 'class="' . $chip['link_class'] . '"' : ''; ?> title="<?php if( $chip['name'] !== esc_html__('Reset all', 'filter-everything') ){
31 if ( $chip['class'] === 'wpc-chip-search' ) {
32 echo esc_attr( sprintf( __('Remove %s from results', 'filter-everything'), '&laquo;'.$chip['label'].'&raquo;' ) );
33 } else {
34 echo esc_attr( sprintf( __('Remove %s from results', 'filter-everything'), '&laquo;'.$chip['label'] .': '.$chip['name'].'&raquo;' ) );
35 }
36 } ?>"<?php echo (!empty($chip['e_name'])) ? ' data-wpc-e-name="' . $chip['e_name'] . '"' : ''; ?><?php echo (!empty($chip['slug'])) ? ' data-wpc-slug="' . $chip['slug'] . '"' : ''; ?>><span class="wpc-chip-content"><?php if(isset($chip['rating'])) : ?><span class="wpc-chip-stars"><?php
37 for ($i = 1; $i <= $chip['rating']; $i++){
38 echo '<span>' . flrt_rating_star() . '</span>';
39 }
40 ?></span><?php
41 else :
42 ?><span class="wpc-filter-chip-name"><?php echo esc_html( $chip['name'] ); ?></span><?php
43 endif;
44 ?><span class="wpc-chip-remove-icon">&#215;</span></span></<?php echo $chip_tag; ?>></li>
45 <?php endforeach; ?>
46 <?php endif; ?>
47 </ul>