Skip to content

Instantly share code, notes, and snippets.

@spivurno
Created February 10, 2024 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spivurno/9aa2ae6b2f7a34a44128375c2943ee40 to your computer and use it in GitHub Desktop.
Save spivurno/9aa2ae6b2f7a34a44128375c2943ee40 to your computer and use it in GitHub Desktop.
<?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