Created
February 10, 2024 12:27
-
-
Save spivurno/9aa2ae6b2f7a34a44128375c2943ee40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'shortcode_atts_gf_progress_meter', function( $atts ) { | |
// Update 123 to your form ID. | |
if ( $atts['id'] == 123 ) { | |
$count = gw_progress_meter()->get_count( $atts ); | |
$goal = $atts['goal']; | |
$percentage = round( $count / $goal * 100 ); | |
$atts['count_label'] = "{$percentage}%"; | |
$atts['goal_label'] = '100%'; | |
} | |
return $atts; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment