PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / dashboard / templates / counters.php

counters.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More trunk, at classes/views/dashboard/templates/counters.php

46 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Dashboard counters widget.
4 *
5 * @package Formidable
6 *
7 * @var array $template Widget data with a 'counters' array. Each counter has: heading, type, counter, cta and optional items.
8 */
9
10 if ( ! defined( 'ABSPATH' ) ) {
11 die( 'You are not allowed to call this page directly.' );
12 }
13
14 $classname = 'frm-counter-card-wrapper frm-flex-box';
15 ?>
16
17 <?php if ( ! empty( $template ) && isset( $template['counters'] ) && is_array( $template['counters'] ) ) : ?>
18 <div class="<?php echo esc_attr( $classname ); ?>">
19
20 <?php foreach ( $template['counters'] as $counter ) : ?>
21 <div class="frm-counter-card frm-dashboard-widget frm-card-item">
22 <h4><?php echo esc_html( $counter['heading'] ); ?></h4>
23 <?php if ( isset( $counter['cta'] ) && isset( $counter['cta']['display'] ) && true === $counter['cta']['display'] ) : ?>
24 <a href="<?php echo esc_url( $counter['cta']['link'] ); ?>"><?php echo esc_html( $counter['cta']['title'] ); ?></a>
25 <?php else : ?>
26 <?php if ( 'currency' === $counter['type'] ) : ?>
27 <div class="frm-flex-box frm-gap-md">
28 <?php foreach ( $counter['items'] as $item ) : ?>
29 <b>
30 <?php echo esc_html( $item['counter_label']['symbol_left'] ); ?>
31 <span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $item['counter']; ?>"><?php echo (int) $item['counter']; ?></span>
32 <?php echo esc_html( $item['counter_label']['symbol_right'] ); ?>
33 </b>
34 <?php endforeach; ?>
35 </div>
36 <?php else : ?>
37 <b>
38 <span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span>
39 </b>
40 <?php endif; ?>
41 <?php endif; ?>
42 </div>
43 <?php endforeach; ?>
44 </div>
45 <?php endif; ?>
46