PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / templates / shortcode-totals-progress.php

shortcode-totals-progress.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at templates/shortcode-totals-progress.php

52 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This template is used to display the progress of [give_totals]
4 */
5
6 // Bail out if total goal is empty.
7 if ( empty( $total_goal ) ) {
8 return false;
9 }
10
11 // Set Give total progress bar color.
12 $color = apply_filters( 'give_totals_progress_color', '#2bc253' );
13
14 // Give total.
15 $total = ! empty( $total ) ? $total : 0;
16
17 /**
18 * Filter the goal progress output
19 *
20 * @since 2.1
21 */
22 $progress = round( ( $total / $total_goal ) * 100, 2 );
23
24 // Set progress to 100 percentage if total > total_goal
25 $progress = $total >= $total_goal ? 100 : $progress;
26 $progress = apply_filters( 'give_goal_totals_funded_percentage_output', $progress, $total, $total_goal );
27
28 ?>
29 <div class="give-goal-progress">
30 <div class="raised">
31 <?php
32 echo sprintf(
33 /* translators: %s: percentage of the amount raised compared to the goal target */
34 __( '<span class="give-percentage">%s%%</span> funded', 'give' ),
35 round( $progress )
36 );
37 ?>
38 </div>
39
40 <div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"
41 aria-valuenow="<?php echo esc_attr( $progress ); ?>">
42 <span style="width: <?php echo esc_attr( $progress ); ?>%;
43 <?php
44 if ( ! empty( $color ) ) {
45 echo 'background-color:' . $color;
46 }
47 ?>
48 "></span>
49 </div><!-- /.give-progress-bar -->
50
51 </div><!-- /.goal-progress -->
52