gform_progress_steps

gform_progress_steps

DescriptionUsageParametersExamples1. Add a custom class to the active step.Source CodeSince

Description
The gform_progress_steps filter can be used to modify or replace the default progress steps markup for multi-page forms.
Usage
The following would apply to all forms.
1add_filter( 'gform_progress_steps', 'your_function_name', 10, 3 );
To limit the scope of your function to a specific form, append the form id to the end of the hook name. (format: gform_progress_steps_FORMID)
1add_filter( 'gform_progress_steps_5', 'your_function_name', 10, 3 );

Parameters

$progress_steps string
HTML string containing the progress steps markup.

$form Form Object
The current form object.

$page integer
The current page number.

Examples
1. Add a custom class to the active step.
1234567add_filter( 'gform_progress_steps', 'progress_steps_markup', 10, 3 );function progress_steps_markup( $progress_steps, $form, $page ) {    $active_class = 'gf_step_active';    $progress_steps = str_replace( $active_class, $active_class . ' your_custom_class', $progress_steps );     return $progress_steps;}
Source Code
This filter is located in GFFormDisplay::get_progress_steps() in form_display.php.
Since
This filter was added in Gravity Forms 2.0-beta-3.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注