Contact Form 7 Multi-Step Forms - Version 1.4.2

Version Description

Download this release

Release Info

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

Code changes from version 1.4.1 to 1.4.2

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: 1.4.1
9
  */
10
  /* Copyright 2012 Webhead LLC (email: info at webheadcoder.com)
11
 
@@ -226,8 +226,17 @@ add_filter( 'wpcf7_posted_data', 'cf7msm_store_data_steps_filter', 9 );
226
  * Clean things up after mail has been sent.
227
  */
228
  function cf7msm_mail_sent() {
229
- cf7msm_remove('step');
230
- cf7msm_remove('cf7msm_posted_data');
 
 
 
 
 
 
 
 
 
231
  }
232
  add_action( 'wpcf7_mail_sent', 'cf7msm_mail_sent' );
233
 
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: 1.4.2
9
  */
10
  /* Copyright 2012 Webhead LLC (email: info at webheadcoder.com)
11
 
226
  * Clean things up after mail has been sent.
227
  */
228
  function cf7msm_mail_sent() {
229
+ if ( isset( $_POST['step'])) {
230
+ $step = $_POST['step'];
231
+ if (preg_match('/(\d+)-(\d+)/', $step, $matches)) {
232
+ $curr_step = $matches[1];
233
+ $last_step = $matches[2];
234
+ }
235
+ if ( $curr_step == $last_step ) {
236
+ cf7msm_remove('step');
237
+ cf7msm_remove('cf7msm_posted_data');
238
+ }
239
+ }
240
  }
241
  add_action( 'wpcf7_mail_sent', 'cf7msm_mail_sent' );
242
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: webheadllc
3
  Tags: contact form 7, multistep form, form, multiple pages, store form
4
  Requires at least: 3.4.1
5
- Tested up to: 4.0
6
- Stable tag: 1.4.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
2
  Contributors: webheadllc
3
  Tags: contact form 7, multistep form, form, multiple pages, store form
4
  Requires at least: 3.4.1
5
+ Tested up to: 4.0.1
6
+ Stable tag: 1.4.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
resources/cf7msm.js CHANGED
@@ -14,7 +14,12 @@ jQuery(document).ready(function($) {
14
  if (key.indexOf('_') != 0 && key != 'step') {
15
  var field = cf7_form.find('*[name="' + key + '"]');
16
  if (field.length > 0) {
17
- field.val(val);
 
 
 
 
 
18
  }
19
  else {
20
  //checkbox
14
  if (key.indexOf('_') != 0 && key != 'step') {
15
  var field = cf7_form.find('*[name="' + key + '"]');
16
  if (field.length > 0) {
17
+ if ( field.prop('type') == 'radio' ) {
18
+ field.filter('input[value="' + val + '"]').prop('checked', true);
19
+ }
20
+ else {
21
+ field.val(val);
22
+ }
23
  }
24
  else {
25
  //checkbox