DescriptionUsageParametersExamples1. Generate custom progress bar markup2. Replace Step with LevelPlacementSinceSource Code
Description
Use this filter to modify or replace the default Gravity Forms progress bar (for multi-page forms).
Usage
Apply to all forms.
add_filter( 'gform_progress_bar', 'my_custom_function', 10, 3 );
Apply to specific forms.
// templateadd_filter( 'gform_progress_bar_{formId}', 'my_custom_function', 10, 3 ); // target form ID 1add_filter( 'gform_progress_bar_1', 'my_custom_function', 10, 3 );
Parameters
$progress_bar stringProgress bar markup as an HTML string.$form Form ObjectCurrent Form object.$confirmation_message stringThe confirmation message to be displayed on the confirmation page.
Examples
1. Generate custom progress bar markup
add_filter( 'gform_progress_bar', function( $progress_bar, $form, $confirmation_message ) { $progress_bar = '
- Page 1
- Page 2
- Page 3
'; return $progress_bar; }, 10, 3 );
2. Replace Step with Level
add_filter( 'gform_progress_bar', function( $progress_bar, $form, $confirmation_message ) { $progress_bar = str_replace( 'Step', 'Level', $progress_bar ); return $progress_bar;}, 10, 3 );
Placement
This code should be placed in the functions.php file of your active theme.
Since
This filter was added in Gravity Forms 2.0.
Source Code
This filter is located in the GFFormDisplay class in form_display.php.