← Back
Editing: progress-bar.php
<?php if (!defined('ABSPATH')) { exit; } // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- template variables; this file is included inside a function, so they are not globals. /** * @since 4.19.1 Escape output. * @since 4.16.3 Escaped the goal color when rendering the progress bar. * * @var int $formId */ if ($form->has_goal()) : ?> <?php $color = give_get_meta($formId, '_give_goal_color', true); $goalStats = give_goal_progress_stats($formId); $style = "width:{$goalStats['progress']}%;"; if ( ! empty($color)) { $style .= ";background: linear-gradient(180deg, {$color} 0%, {$color} 100%), linear-gradient(180deg, #fff 0%, #ccc 100%); background-blend-mode: multiply;"; } ?> <div class="progress-bar"> <div class="give-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="<?php echo esc_attr($goalStats['progress']); ?>"> <span style="<?php echo esc_attr($style); ?>"></span> </div><!-- /.give-progress-bar --> </div> <?php endif; ?>
Save File
Cancel