PluginProbe
Filter Everything — WordPress & WooCommerce Filters / trunk
Filter Everything — WordPress & WooCommerce Filters vtrunk
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 1.6.3 All 51 releases
filter-everything / views / frontend / chips.php

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

48 lines 2.9 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 global $chips_count;
16 // Iterate global chips widget count
17 $selected_and_above_status = (isset($filter['selected_and_above']) && $filter['selected_and_above'] === 'yes') ? true : false;
18 $chips_count++;
19 ?>
20 <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 ; ?>">
21 <?php if( $chips ) : ?>
22 <?php foreach( $chips as $chip ): ?>
23 <?php
24 // Smart spans: a chip whose removal target is not indexable must
25 // not expose a crawlable link (missing 'crawlable' means a link)
26 $chip_is_link = ! isset( $chip['crawlable'] ) || $chip['crawlable'];
27 $chip_tag = $chip_is_link ? 'a' : 'span';
28 $chip_link_att = $chip_is_link ? 'href' : 'data-wpc-span-link';
29 ?>
30 <li class="wpc-filter-chip <?php echo esc_attr( $chip['class'] ); ?>">
31 <<?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') ){
32 if ( $chip['class'] === 'wpc-chip-search' ) {
33 echo esc_attr( sprintf( __('Remove %s from results', 'filter-everything'), '&laquo;'.$chip['label'].'&raquo;' ) );
34 } else {
35 echo esc_attr( sprintf( __('Remove %s from results', 'filter-everything'), '&laquo;'.$chip['label'] .': '.$chip['name'].'&raquo;' ) );
36 }
37 } ?>"<?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
38 for ($i = 1; $i <= $chip['rating']; $i++){
39 echo '<span>' . flrt_rating_star() . '</span>';
40 }
41 ?></span><?php
42 else :
43 ?><span class="wpc-filter-chip-name"><?php echo esc_html( $chip['name'] ); ?></span><?php
44 endif;
45 ?><span class="wpc-chip-remove-icon">&#215;</span></span></<?php echo $chip_tag; ?>></li>
46 <?php endforeach; ?>
47 <?php endif; ?>
48 </ul>