Steps beyond 3 [SOLVED]
-
I realized this plugin does not go beyond step 3.
I found a thread that identified where to extend the functionality, but it required hardcoding a specific number, which would mean every form has to have the exact same steps.
The solution needs to work on any form and dynamically count how many steps a form has.
Here’s the solution:
In the init.php doc in “inc->frontend” you can replace the original function with the following.
function cf7mls_multistep_shortcode_callback($tag) $tag = new WPCF7_Shortcode($tag); $steps = 0; $contact_form = wpcf7_get_current_contact_form(); $form_tags = $contact_form->scan_form_tags(); $steps += count($form_tags)/2; $found = 0; $html = ''; if ($form_tags) { foreach ($form_tags as $k => $v) { if ($v['type'] == $tag->type) { $found++; } if ($v['name'] == $tag->name) { if ($found <= $steps) { $html = '<button type="button" class="cf7mls_back action-button" name="cf7mls_back">Back</button>'; $html .= '<button type="button" class="cf7mls_next cf7mls_btn action-button" name="cf7mls_next">Next</button>'; $html .= '</fieldset><fieldset class="fieldset-cf7mls">'; } break; } } }
(I’m sure someone can simplify what I wrote. I’m not the most experienced.)
To NinjaForms, could this be baked into the next update?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Steps beyond 3 [SOLVED]’ is closed to new replies.