Contact Form 7 Multi-Step Forms - Version 2.0.1

Version Description

Minor fix to detecting if previous form was filled.

Download this release

Release Info

Developer webheadllc
Plugin Icon 128x128 Contact Form 7 Multi-Step Forms
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0 to 2.0.1

Files changed (2) hide show
  1. contact-form-7-multi-step-module.php +19 -20
  2. readme.txt +5 -1
contact-form-7-multi-step-module.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.mymonkeydo.com/contact-form-7-multi-step-module/
5
  Description: Enables the Contact Form 7 plugin to create multi-page, multi-step forms.
6
  Author: Webhead LLC.
7
  Author URI: http://webheadcoder.com
8
- Version: 2.0
9
  */
10
  /* Copyright 2012 Webhead LLC (email: info at webheadcoder.com)
11
 
@@ -24,7 +24,7 @@ Version: 2.0
24
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
  */
26
 
27
- define( 'CF7MSM_VERSION', '2.0' );
28
  define( 'CF7MSM_PLUGIN', __FILE__ );
29
  define( 'CF7MSM_FREE_TEXT_PREFIX_RADIO', '_wpcf7_radio_free_text_' );
30
  define( 'CF7MSM_FREE_TEXT_PREFIX_CHECKBOX', '_wpcf7_checkbox_free_text_' );
@@ -205,27 +205,26 @@ function cf7msm_step_2($cf7) {
205
  $formstring = $cf7->form;
206
  $form_id = $cf7->id;
207
  }
208
- if ( !empty( $_POST['_wpcf7'] ) && $_POST['_wpcf7'] == $form_id ) {
209
- //check if form has a step field
210
- if (!is_admin() &&
211
- ( preg_match('/\[multistep "(\d+)-(\d+)-?(.*)"\]/', $formstring, $matches) || preg_match('/\[hidden step "(\d+)-(\d+)"\]/', $formstring, $matches) ) ) {
212
- $step = cf7msm_get('step');
213
- if ( !isset($matches[1])
214
- || ($matches[1] != 1 && empty($step) )
215
- || ($matches[1] != 1 && ((int) $step) + 1 < $matches[1]) ) {
216
- if ( $has_wpcf7_class ) {
217
- $cf7->set_properties( array(
218
- 'form' => apply_filters('wh_hide_cf7_step_message', "Please fill out the form on the previous page")
219
- ) );
220
- }
221
- else {
222
- $cf7->form = apply_filters('wh_hide_cf7_step_message', "Please fill out the form on the previous page");
223
- }
224
  }
225
- if (count($matches) >= 3 && $matches[1] != $matches[2]) {
226
- add_filter('wpcf7_ajax_json_echo', 'cf7msm_clear_success_message', 10, 2);
227
  }
228
  }
 
 
 
229
  }
230
 
231
  return $cf7;
5
  Description: Enables the Contact Form 7 plugin to create multi-page, multi-step forms.
6
  Author: Webhead LLC.
7
  Author URI: http://webheadcoder.com
8
+ Version: 2.0.1
9
  */
10
  /* Copyright 2012 Webhead LLC (email: info at webheadcoder.com)
11
 
24
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
  */
26
 
27
+ define( 'CF7MSM_VERSION', '2.0.1' );
28
  define( 'CF7MSM_PLUGIN', __FILE__ );
29
  define( 'CF7MSM_FREE_TEXT_PREFIX_RADIO', '_wpcf7_radio_free_text_' );
30
  define( 'CF7MSM_FREE_TEXT_PREFIX_CHECKBOX', '_wpcf7_checkbox_free_text_' );
205
  $formstring = $cf7->form;
206
  $form_id = $cf7->id;
207
  }
208
+
209
+ //check if form has a step field
210
+ if (!is_admin() &&
211
+ ( preg_match('/\[multistep "(\d+)-(\d+)-?(.*)"\]/', $formstring, $matches) || preg_match('/\[hidden step "(\d+)-(\d+)"\]/', $formstring, $matches) ) ) {
212
+ $step = cf7msm_get('step');
213
+ if ( !isset($matches[1])
214
+ || ($matches[1] != 1 && empty($step) )
215
+ || ($matches[1] != 1 && ((int) $step) + 1 < $matches[1]) ) {
216
+ if ( $has_wpcf7_class ) {
217
+ $cf7->set_properties( array(
218
+ 'form' => apply_filters('wh_hide_cf7_step_message', "Please fill out the form on the previous page")
219
+ ) );
 
 
 
 
220
  }
221
+ else {
222
+ $cf7->form = apply_filters('wh_hide_cf7_step_message', "Please fill out the form on the previous page");
223
  }
224
  }
225
+ if (count($matches) >= 3 && $matches[1] != $matches[2]) {
226
+ add_filter('wpcf7_ajax_json_echo', 'cf7msm_clear_success_message', 10, 2);
227
+ }
228
  }
229
 
230
  return $cf7;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate Link: http://webheadcoder.com/donate-cf7-multi-step-forms
4
  Tags: contact form 7, multistep form, form, multiple pages, store form
5
  Requires at least: 3.4.1
6
  Tested up to: 4.4.2
7
- Stable tag: 2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -95,6 +95,10 @@ The multiform form-tag should only be used on the Form tab. On the Mail tab fol
95
 
96
  == Changelog ==
97
 
 
 
 
 
98
  = 2.0 =
99
  Added Form Tags to Form Tag Generator. No more needing to update the Additional Settings tab.
100
  Added error alert when form is too large.
4
  Tags: contact form 7, multistep form, form, multiple pages, store form
5
  Requires at least: 3.4.1
6
  Tested up to: 4.4.2
7
+ Stable tag: 2.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
95
 
96
  == Changelog ==
97
 
98
+ = 2.0.1 =
99
+ Minor fix to detecting if previous form was filled.
100
+
101
+
102
  = 2.0 =
103
  Added Form Tags to Form Tag Generator. No more needing to update the Additional Settings tab.
104
  Added error alert when form is too large.