footer.php
4 years ago
form-navigator.php
4 years ago
income-stats.php
1 year ago
introduction.php
1 week ago
progress-bar.php
2 days ago
progress-bar.php
26 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * @since 4.16.3 Escaped the goal color when rendering the progress bar. |
| 5 | * |
| 6 | * @var int $formId |
| 7 | */ |
| 8 | if ($form->has_goal()) : ?> |
| 9 | <?php |
| 10 | $color = give_get_meta($formId, '_give_goal_color', true); |
| 11 | $goalStats = give_goal_progress_stats($formId); |
| 12 | |
| 13 | $style = "width:{$goalStats['progress']}%;"; |
| 14 | if ( ! empty($color)) { |
| 15 | $style .= ";background: linear-gradient(180deg, {$color} 0%, {$color} 100%), linear-gradient(180deg, #fff 0%, #ccc 100%); background-blend-mode: multiply;"; |
| 16 | } |
| 17 | ?> |
| 18 | <div class="progress-bar"> |
| 19 | <div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="<?php |
| 20 | echo $goalStats['progress']; ?>"> |
| 21 | <span style="<?php echo esc_attr($style); ?>"></span> |
| 22 | </div><!-- /.give-progress-bar --> |
| 23 | </div> |
| 24 | <?php |
| 25 | endif; ?> |
| 26 |