Bootstrap for Contact Form 7 - Version 1.4.3

Version Description

  • Fixed: plugin compatibility fatal errors with Contact Form 7 version 4.8 related to form validation and REALLY SIMPLE CAPTCHA
  • Fixed: Contact Form 7 version 4.7 features are now being used
  • Fixed: correct styles for latest Contact Form 7 versions are now being printed
Download this release

Release Info

Developer flixos90
Plugin Icon 128x128 Bootstrap for Contact Form 7
Version 1.4.3
Comparing to
See all releases

Code changes from version 1.4.2 to 1.4.3

assets/dist/js/scripts.js CHANGED
@@ -3,9 +3,42 @@
3
  * By Felix Arntz (https://leaves-and-love.net)
4
  * Licensed under GNU General Public License v3 (http://www.gnu.org/licenses/gpl-3.0.html)
5
  */
6
- +function ( $ ) {
7
  'use strict';
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  // add Bootstrap Alert classes to response output
10
  $( function() {
11
  $( 'div.wpcf7' ).on( 'invalid.wpcf7', function() {
@@ -78,8 +111,8 @@
78
  }
79
  $( this ).find( 'div.form-group' ).removeClass( 'has-error' );
80
  $( this ).find( 'span.wpcf7-not-valid-tip' ).remove();
81
- $( this ).find( 'img.ajax-loader' ).css({ visibility: 'hidden' });
82
  });
83
  };
84
 
85
- }(jQuery);
3
  * By Felix Arntz (https://leaves-and-love.net)
4
  * Licensed under GNU General Public License v3 (http://www.gnu.org/licenses/gpl-3.0.html)
5
  */
6
+ ( function ( $ ) {
7
  'use strict';
8
 
9
+ window.wpcf7.notValidTip = function( target, message ) {
10
+ var $target = $( target );
11
+
12
+ $target.addClass( 'has-error' );
13
+ $( '.wpcf7-not-valid-tip', $target ).remove();
14
+
15
+ if ( ! $target.parents( '.wpcf7-form' ).hasClass( 'form-inline' ) ) {
16
+ if ( $target.parents( '.wpcf7-form' ).hasClass( 'form-horizontal' ) ) {
17
+ $target.children( 'div' ).append( '<span class="help-block wpcf7-not-valid-tip">' + message + '</span>' );
18
+ } else {
19
+ $target.append( '<span class="help-block wpcf7-not-valid-tip">' + message + '</span>' );
20
+ }
21
+
22
+ if ( $target.is( '.use-floating-validation-tip *' ) ) {
23
+ var fadeOut = function( target ) {
24
+ $( target ).not( ':hidden' ).animate( {
25
+ opacity: 0
26
+ }, 'fast', function() {
27
+ $( this ).css( { 'z-index': -100 } );
28
+ } );
29
+ };
30
+
31
+ $target.on( 'mouseover', '.wpcf7-not-valid-tip', function() {
32
+ fadeOut( this );
33
+ } );
34
+
35
+ $target.on( 'focus', ':input', function() {
36
+ fadeOut( $( '.wpcf7-not-valid-tip', $target ) );
37
+ } );
38
+ }
39
+ }
40
+ };
41
+
42
  // add Bootstrap Alert classes to response output
43
  $( function() {
44
  $( 'div.wpcf7' ).on( 'invalid.wpcf7', function() {
111
  }
112
  $( this ).find( 'div.form-group' ).removeClass( 'has-error' );
113
  $( this ).find( 'span.wpcf7-not-valid-tip' ).remove();
114
+ $( this ).find( 'img.ajax-loader' ).removeClass( 'is-active' );
115
  });
116
  };
117
 
118
+ } )( jQuery );
assets/dist/js/scripts.min.js CHANGED
@@ -3,4 +3,4 @@
3
  * By Felix Arntz (https://leaves-and-love.net)
4
  * Licensed under GNU General Public License v3 (http://www.gnu.org/licenses/gpl-3.0.html)
5
  */
6
- +function(i){"use strict";i(function(){i("div.wpcf7").on("invalid.wpcf7",function(){i(this).find("div.wpcf7-response-output").addClass("alert-warning")}),i("div.wpcf7").on("spam.wpcf7",function(){i(this).find("div.wpcf7-response-output").addClass("alert-warning")}),i("div.wpcf7").on("mailsent.wpcf7",function(){i(this).find("div.wpcf7-response-output").addClass("alert-success")}),i("div.wpcf7").on("mailfailed.wpcf7",function(){i(this).find("div.wpcf7-response-output").addClass("alert-danger")}),i("div.wpcf7").on("click","div.wpcf7-response-output .close",function(n){i(this).parent().hide(),n.preventDefault()})}),i.fn.wpcf7NotValidTip=function(n){return this.each(function(){var t=i(this);t.addClass("has-error"),t.parents(".wpcf7-form").hasClass("form-inline")||(t.find("span.wpcf7-not-valid-tip").remove(),t.parents(".wpcf7-form").hasClass("form-horizontal")?t.children("div").append('<span class="help-block wpcf7-not-valid-tip">'+n+"</span>"):t.append('<span class="help-block wpcf7-not-valid-tip">'+n+"</span>"),t.slideDown("fast"),t.is(".use-floating-validation-tip *")&&(i(".wpcf7-not-valid-tip",t).mouseover(function(){i(this).wpcf7FadeOut()}),i(":input",t).focus(function(){i(".wpcf7-not-valid-tip",t).not(":hidden").wpcf7FadeOut()})))})},i.fn.wpcf7RefillQuiz=function(n){return this.each(function(){var t=i(this);i.each(n,function(i,n){t.find(':input[name="'+i+'"]').clearFields(),t.find(':input[name="'+i+'"]').siblings("p.wpcf7-quiz-label").text(n[0]),t.find('input:hidden[name="_wpcf7_quiz_answer_'+i+'"]').attr("value",n[1])})})},i.fn.wpcf7ClearResponseOutput=function(){return this.each(function(){var n=i(this).find("div.wpcf7-response-output .close");i(this).find("div.wpcf7-response-output").hide().empty().removeClass("wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked alert-warning alert-success alert-danger").removeAttr("role"),0<n.length&&i(this).find("div.wpcf7-response-output").append(n),i(this).find("div.form-group").removeClass("has-error"),i(this).find("span.wpcf7-not-valid-tip").remove(),i(this).find("img.ajax-loader").css({visibility:"hidden"})})}}(jQuery);
3
  * By Felix Arntz (https://leaves-and-love.net)
4
  * Licensed under GNU General Public License v3 (http://www.gnu.org/licenses/gpl-3.0.html)
5
  */
6
+ !function(n){"use strict";window.wpcf7.notValidTip=function(i,t){var s=n(i);if(s.addClass("has-error"),n(".wpcf7-not-valid-tip",s).remove(),!s.parents(".wpcf7-form").hasClass("form-inline")&&(s.parents(".wpcf7-form").hasClass("form-horizontal")?s.children("div").append('<span class="help-block wpcf7-not-valid-tip">'+t+"</span>"):s.append('<span class="help-block wpcf7-not-valid-tip">'+t+"</span>"),s.is(".use-floating-validation-tip *"))){var a=function(i){n(i).not(":hidden").animate({opacity:0},"fast",function(){n(this).css({"z-index":-100})})};s.on("mouseover",".wpcf7-not-valid-tip",function(){a(this)}),s.on("focus",":input",function(){a(n(".wpcf7-not-valid-tip",s))})}},n(function(){n("div.wpcf7").on("invalid.wpcf7",function(){n(this).find("div.wpcf7-response-output").addClass("alert-warning")}),n("div.wpcf7").on("spam.wpcf7",function(){n(this).find("div.wpcf7-response-output").addClass("alert-warning")}),n("div.wpcf7").on("mailsent.wpcf7",function(){n(this).find("div.wpcf7-response-output").addClass("alert-success")}),n("div.wpcf7").on("mailfailed.wpcf7",function(){n(this).find("div.wpcf7-response-output").addClass("alert-danger")}),n("div.wpcf7").on("click","div.wpcf7-response-output .close",function(i){n(this).parent().hide(),i.preventDefault()})}),n.fn.wpcf7NotValidTip=function(i){return this.each(function(){var t=n(this);t.addClass("has-error"),t.parents(".wpcf7-form").hasClass("form-inline")||(t.find("span.wpcf7-not-valid-tip").remove(),t.parents(".wpcf7-form").hasClass("form-horizontal")?t.children("div").append('<span class="help-block wpcf7-not-valid-tip">'+i+"</span>"):t.append('<span class="help-block wpcf7-not-valid-tip">'+i+"</span>"),t.slideDown("fast"),t.is(".use-floating-validation-tip *")&&(n(".wpcf7-not-valid-tip",t).mouseover(function(){n(this).wpcf7FadeOut()}),n(":input",t).focus(function(){n(".wpcf7-not-valid-tip",t).not(":hidden").wpcf7FadeOut()})))})},n.fn.wpcf7RefillQuiz=function(i){return this.each(function(){var t=n(this);n.each(i,function(n,i){t.find(':input[name="'+n+'"]').clearFields(),t.find(':input[name="'+n+'"]').siblings("p.wpcf7-quiz-label").text(i[0]),t.find('input:hidden[name="_wpcf7_quiz_answer_'+n+'"]').attr("value",i[1])})})},n.fn.wpcf7ClearResponseOutput=function(){return this.each(function(){var i=n(this).find("div.wpcf7-response-output .close");n(this).find("div.wpcf7-response-output").hide().empty().removeClass("wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked alert-warning alert-success alert-danger").removeAttr("role"),0<i.length&&n(this).find("div.wpcf7-response-output").append(i),n(this).find("div.form-group").removeClass("has-error"),n(this).find("span.wpcf7-not-valid-tip").remove(),n(this).find("img.ajax-loader").removeClass("is-active")})}}(jQuery);
assets/src/js/scripts.js CHANGED
@@ -1,6 +1,39 @@
1
- +function ( $ ) {
2
  'use strict';
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  // add Bootstrap Alert classes to response output
5
  $( function() {
6
  $( 'div.wpcf7' ).on( 'invalid.wpcf7', function() {
@@ -73,8 +106,8 @@
73
  }
74
  $( this ).find( 'div.form-group' ).removeClass( 'has-error' );
75
  $( this ).find( 'span.wpcf7-not-valid-tip' ).remove();
76
- $( this ).find( 'img.ajax-loader' ).css({ visibility: 'hidden' });
77
  });
78
  };
79
 
80
- }(jQuery);
1
+ ( function ( $ ) {
2
  'use strict';
3
 
4
+ window.wpcf7.notValidTip = function( target, message ) {
5
+ var $target = $( target );
6
+
7
+ $target.addClass( 'has-error' );
8
+ $( '.wpcf7-not-valid-tip', $target ).remove();
9
+
10
+ if ( ! $target.parents( '.wpcf7-form' ).hasClass( 'form-inline' ) ) {
11
+ if ( $target.parents( '.wpcf7-form' ).hasClass( 'form-horizontal' ) ) {
12
+ $target.children( 'div' ).append( '<span class="help-block wpcf7-not-valid-tip">' + message + '</span>' );
13
+ } else {
14
+ $target.append( '<span class="help-block wpcf7-not-valid-tip">' + message + '</span>' );
15
+ }
16
+
17
+ if ( $target.is( '.use-floating-validation-tip *' ) ) {
18
+ var fadeOut = function( target ) {
19
+ $( target ).not( ':hidden' ).animate( {
20
+ opacity: 0
21
+ }, 'fast', function() {
22
+ $( this ).css( { 'z-index': -100 } );
23
+ } );
24
+ };
25
+
26
+ $target.on( 'mouseover', '.wpcf7-not-valid-tip', function() {
27
+ fadeOut( this );
28
+ } );
29
+
30
+ $target.on( 'focus', ':input', function() {
31
+ fadeOut( $( '.wpcf7-not-valid-tip', $target ) );
32
+ } );
33
+ }
34
+ }
35
+ };
36
+
37
  // add Bootstrap Alert classes to response output
38
  $( function() {
39
  $( 'div.wpcf7' ).on( 'invalid.wpcf7', function() {
106
  }
107
  $( this ).find( 'div.form-group' ).removeClass( 'has-error' );
108
  $( this ).find( 'span.wpcf7-not-valid-tip' ).remove();
109
+ $( this ).find( 'img.ajax-loader' ).removeClass( 'is-active' );
110
  });
111
  };
112
 
113
+ } )( jQuery );
bootstrap-for-contact-form-7.php CHANGED
@@ -1,22 +1,22 @@
1
  <?php
2
- /*
3
- Plugin Name: Bootstrap for Contact Form 7
4
- Plugin URI: https://wordpress.org/plugins/bootstrap-for-contact-form-7/
5
- Description: This plugin modifies the output of the popular Contact Form 7 plugin to be styled in compliance with themes using the Bootstrap CSS framework.
6
- Version: 1.4.2
7
- Author: Felix Arntz
8
- Author URI: https://leaves-and-love.net
9
- License: GNU General Public License v3
10
- License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
- Text Domain: bootstrap-for-contact-form-7
12
- Tags: contact form 7, wpcf7, bootstrap, bootstrap 3, bootstrap framework, addon, contact form 7 addon, contact form, cf7bs
13
- */
14
  /**
15
  * Plugin initialization file
16
  *
17
  * @package CF7BS
18
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
19
  * @since 1.0.0
 
 
 
 
 
 
 
 
 
 
 
 
20
  */
21
 
22
  if ( ! defined( 'WPCF7_AUTOP' ) ) {
@@ -24,7 +24,7 @@ if ( ! defined( 'WPCF7_AUTOP' ) ) {
24
  }
25
 
26
  function cf7bs_maybe_init() {
27
- define( 'CF7BS_VERSION', '1.4.2' );
28
  define( 'CF7BS_MAINFILE', __FILE__ );
29
  define( 'CF7BS_PATH', untrailingslashit( plugin_dir_path( CF7BS_MAINFILE ) ) );
30
  define( 'CF7BS_URL', untrailingslashit( plugin_dir_url( CF7BS_MAINFILE ) ) );
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Plugin initialization file
4
  *
5
  * @package CF7BS
6
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
7
  * @since 1.0.0
8
+ *
9
+ * @wordpress-plugin
10
+ * Plugin Name: Bootstrap for Contact Form 7
11
+ * Plugin URI: https://wordpress.org/plugins/bootstrap-for-contact-form-7/
12
+ * Description: This plugin modifies the output of the popular Contact Form 7 plugin to be styled in compliance with themes using the Bootstrap CSS framework.
13
+ * Version: 1.4.3
14
+ * Author: Felix Arntz
15
+ * Author URI: https://leaves-and-love.net
16
+ * License: GNU General Public License v3
17
+ * License URI: http://www.gnu.org/licenses/gpl-3.0.html
18
+ * Text Domain: bootstrap-for-contact-form-7
19
+ * Tags: contact form 7, wpcf7, bootstrap, bootstrap 3, bootstrap framework, addon, contact form 7 addon, contact form, cf7bs
20
  */
21
 
22
  if ( ! defined( 'WPCF7_AUTOP' ) ) {
24
  }
25
 
26
  function cf7bs_maybe_init() {
27
+ define( 'CF7BS_VERSION', '1.4.3' );
28
  define( 'CF7BS_MAINFILE', __FILE__ );
29
  define( 'CF7BS_PATH', untrailingslashit( plugin_dir_path( CF7BS_MAINFILE ) ) );
30
  define( 'CF7BS_URL', untrailingslashit( plugin_dir_url( CF7BS_MAINFILE ) ) );
changelog.txt CHANGED
@@ -1,5 +1,10 @@
1
  == Changelog ==
2
 
 
 
 
 
 
3
  = 1.4.2 =
4
  * Fixed: plugin compatibility fatal errors with Contact Form 7 version 4.6 with count and CAPTCHA shortcodes
5
 
1
  == Changelog ==
2
 
3
+ = 1.4.3 =
4
+ * Fixed: plugin compatibility fatal errors with Contact Form 7 version 4.8 related to form validation and REALLY SIMPLE CAPTCHA
5
+ * Fixed: Contact Form 7 version 4.7 features are now being used
6
+ * Fixed: correct styles for latest Contact Form 7 versions are now being printed
7
+
8
  = 1.4.2 =
9
  * Fixed: plugin compatibility fatal errors with Contact Form 7 version 4.6 with count and CAPTCHA shortcodes
10
 
modifications.php CHANGED
@@ -97,34 +97,77 @@ function cf7bs_enqueue_styles() {
97
  add_action( 'wpcf7_enqueue_styles', 'cf7bs_enqueue_styles' );
98
 
99
  function cf7bs_inline_styles() {
 
 
 
100
  ?>
101
  <style type="text/css">
102
  div.wpcf7 .screen-reader-response {
103
- display: none;
 
 
 
 
 
 
 
 
 
 
 
104
  }
105
- div.wpcf7 img.ajax-loader {
 
 
 
 
 
 
106
  border: none;
 
 
107
  vertical-align: middle;
108
- margin-left: 4px;
109
  }
110
- div.wpcf7 .form-inline img.ajax-loader {
111
- display: inline;
 
112
  }
 
113
  div.wpcf7 div.ajax-error {
114
  display: none;
115
  }
 
116
  div.wpcf7 .wpcf7-display-none {
117
  display: none;
118
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  div.wpcf7 .form-inline .form-group {
120
  max-width: 250px;
121
  }
 
122
  div.wpcf7 .input-group-addon img {
123
  height: 100%;
124
  width: auto;
125
  max-width: none !important;
126
  border-radius: 5px;
127
  }
 
128
  div.wpcf7 .input-group-addon.input-group-has-image {
129
  padding: 0;
130
  }
@@ -276,3 +319,22 @@ function cf7bs_editor_panels( $panels ) {
276
  return $panels;
277
  }
278
  add_filter( 'wpcf7_editor_panels', 'cf7bs_editor_panels' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  add_action( 'wpcf7_enqueue_styles', 'cf7bs_enqueue_styles' );
98
 
99
  function cf7bs_inline_styles() {
100
+ $url = function_exists( 'wpcf7_plugin_url' ) ? wpcf7_plugin_url() : WPCF7_PLUGIN_URL;
101
+ $url = untrailingslashit( $url );
102
+
103
  ?>
104
  <style type="text/css">
105
  div.wpcf7 .screen-reader-response {
106
+ position: absolute;
107
+ overflow: hidden;
108
+ clip: rect(1px, 1px, 1px, 1px);
109
+ height: 1px;
110
+ width: 1px;
111
+ margin: 0;
112
+ padding: 0;
113
+ border: 0;
114
+ }
115
+
116
+ div.wpcf7 .form-inline img.ajax-loader {
117
+ display: inline;
118
  }
119
+
120
+ div.wpcf7 .ajax-loader {
121
+ visibility: hidden;
122
+ display: inline-block;
123
+ background-image: url('<?php echo $url . '/images/ajax-loader.gif'; ?>');
124
+ width: 16px;
125
+ height: 16px;
126
  border: none;
127
+ padding: 0;
128
+ margin: 0 0 0 4px;
129
  vertical-align: middle;
 
130
  }
131
+
132
+ div.wpcf7 .ajax-loader.is-active {
133
+ visibility: visible;
134
  }
135
+
136
  div.wpcf7 div.ajax-error {
137
  display: none;
138
  }
139
+
140
  div.wpcf7 .wpcf7-display-none {
141
  display: none;
142
  }
143
+
144
+ div.wpcf7 .placeheld {
145
+ color: #888;
146
+ }
147
+
148
+ div.wpcf7 .wpcf7-recaptcha iframe {
149
+ margin-bottom: 0;
150
+ }
151
+
152
+ div.wpcf7 input[type="file"] {
153
+ cursor: pointer;
154
+ }
155
+
156
+ div.wpcf7 input[type="file"]:disabled {
157
+ cursor: default;
158
+ }
159
+
160
  div.wpcf7 .form-inline .form-group {
161
  max-width: 250px;
162
  }
163
+
164
  div.wpcf7 .input-group-addon img {
165
  height: 100%;
166
  width: auto;
167
  max-width: none !important;
168
  border-radius: 5px;
169
  }
170
+
171
  div.wpcf7 .input-group-addon.input-group-has-image {
172
  padding: 0;
173
  }
319
  return $panels;
320
  }
321
  add_filter( 'wpcf7_editor_panels', 'cf7bs_editor_panels' );
322
+
323
+ function cf7bs_adjust_rest_feedback_response( $response, $result ) {
324
+ if ( 'validation_failed' == $result['status'] ) {
325
+ $invalid_fields = array();
326
+
327
+ foreach ( (array) $result['invalid_fields'] as $name => $field ) {
328
+ $invalid_fields[] = array(
329
+ 'into' => '.form-group.' . sanitize_html_class( $name ),
330
+ 'message' => $field['reason'],
331
+ 'idref' => $field['idref'],
332
+ );
333
+ }
334
+
335
+ $response['invalidFields'] = $invalid_fields;
336
+ }
337
+
338
+ return $response;
339
+ }
340
+ add_filter( 'wpcf7_ajax_json_echo', 'cf7bs_adjust_rest_feedback_response', 10, 2 );
modules/acceptance.php CHANGED
@@ -20,7 +20,12 @@ function cf7bs_add_shortcode_acceptance() {
20
  call_user_func( $remove_func, $tag );
21
  }
22
 
23
- call_user_func( $add_func, $tags, 'cf7bs_acceptance_shortcode_handler', true );
 
 
 
 
 
24
  }
25
 
26
  function cf7bs_acceptance_shortcode_handler( $tag ) {
20
  call_user_func( $remove_func, $tag );
21
  }
22
 
23
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
24
+ 'name-attr' => true,
25
+ 'do-not-store' => true,
26
+ );
27
+
28
+ call_user_func( $add_func, $tags, 'cf7bs_acceptance_shortcode_handler', $features );
29
  }
30
 
31
  function cf7bs_acceptance_shortcode_handler( $tag ) {
modules/checkbox.php CHANGED
@@ -22,7 +22,13 @@ function cf7bs_add_shortcode_checkbox() {
22
  call_user_func( $remove_func, $tag );
23
  }
24
 
25
- call_user_func( $add_func, $tags, 'cf7bs_checkbox_shortcode_handler', true );
 
 
 
 
 
 
26
  }
27
 
28
  function cf7bs_checkbox_shortcode_handler( $tag ) {
22
  call_user_func( $remove_func, $tag );
23
  }
24
 
25
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
26
+ 'name-attr' => true,
27
+ 'selectable-values' => true,
28
+ 'multiple-controls-container' => true,
29
+ );
30
+
31
+ call_user_func( $add_func, $tags, 'cf7bs_checkbox_shortcode_handler', $features );
32
  }
33
 
34
  function cf7bs_checkbox_shortcode_handler( $tag ) {
modules/count.php CHANGED
@@ -20,7 +20,11 @@ function cf7bs_add_shortcode_count() {
20
  call_user_func( $remove_func, $tag );
21
  }
22
 
23
- call_user_func( $add_func, $tags, 'cf7bs_count_shortcode_handler', true );
 
 
 
 
24
  }
25
 
26
  function cf7bs_count_shortcode_handler( $tag ) {
20
  call_user_func( $remove_func, $tag );
21
  }
22
 
23
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
24
+ 'name-attr' => true,
25
+ );
26
+
27
+ call_user_func( $add_func, $tags, 'cf7bs_count_shortcode_handler', $features );
28
  }
29
 
30
  function cf7bs_count_shortcode_handler( $tag ) {
modules/date.php CHANGED
@@ -21,7 +21,11 @@ function cf7bs_add_shortcode_date() {
21
  call_user_func( $remove_func, $tag );
22
  }
23
 
24
- call_user_func( $add_func, $tags, 'cf7bs_date_shortcode_handler', true );
 
 
 
 
25
  }
26
 
27
  function cf7bs_date_shortcode_handler( $tag ) {
21
  call_user_func( $remove_func, $tag );
22
  }
23
 
24
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
25
+ 'name-attr' => true,
26
+ );
27
+
28
+ call_user_func( $add_func, $tags, 'cf7bs_date_shortcode_handler', $features );
29
  }
30
 
31
  function cf7bs_date_shortcode_handler( $tag ) {
modules/file.php CHANGED
@@ -21,7 +21,11 @@ function cf7bs_add_shortcode_file() {
21
  call_user_func( $remove_func, $tag );
22
  }
23
 
24
- call_user_func( $add_func, $tags, 'cf7bs_file_shortcode_handler', true );
 
 
 
 
25
  }
26
 
27
  function cf7bs_file_shortcode_handler( $tag ) {
21
  call_user_func( $remove_func, $tag );
22
  }
23
 
24
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
25
+ 'name-attr' => true,
26
+ );
27
+
28
+ call_user_func( $add_func, $tags, 'cf7bs_file_shortcode_handler', $features );
29
  }
30
 
31
  function cf7bs_file_shortcode_handler( $tag ) {
modules/number.php CHANGED
@@ -23,7 +23,11 @@ function cf7bs_add_shortcode_number() {
23
  call_user_func( $remove_func, $tag );
24
  }
25
 
26
- call_user_func( $add_func, $tags, 'cf7bs_number_shortcode_handler', true );
 
 
 
 
27
  }
28
 
29
  function cf7bs_number_shortcode_handler( $tag ) {
23
  call_user_func( $remove_func, $tag );
24
  }
25
 
26
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
27
+ 'name-attr' => true,
28
+ );
29
+
30
+ call_user_func( $add_func, $tags, 'cf7bs_number_shortcode_handler', $features );
31
  }
32
 
33
  function cf7bs_number_shortcode_handler( $tag ) {
modules/quiz.php CHANGED
@@ -20,7 +20,12 @@ function cf7bs_add_shortcode_quiz() {
20
  call_user_func( $remove_func, $tag );
21
  }
22
 
23
- call_user_func( $add_func, $tags, 'cf7bs_quiz_shortcode_handler', true );
 
 
 
 
 
24
  }
25
 
26
  function cf7bs_quiz_shortcode_handler( $tag ) {
20
  call_user_func( $remove_func, $tag );
21
  }
22
 
23
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
24
+ 'name-attr' => true,
25
+ 'do-not-store' => true,
26
+ );
27
+
28
+ call_user_func( $add_func, $tags, 'cf7bs_quiz_shortcode_handler', $features );
29
  }
30
 
31
  function cf7bs_quiz_shortcode_handler( $tag ) {
modules/really-simple-captcha.php CHANGED
@@ -21,7 +21,18 @@ function cf7bs_add_shortcode_captcha() {
21
  call_user_func( $remove_func, $tag );
22
  }
23
 
24
- call_user_func( $add_func, $tags, 'cf7bs_captcha_shortcode_handler', true );
 
 
 
 
 
 
 
 
 
 
 
25
  }
26
 
27
  function cf7bs_captcha_shortcode_handler( $tag ) {
@@ -40,15 +51,15 @@ function cf7bs_captcha_shortcode_handler( $tag ) {
40
  $validation_error = wpcf7_get_validation_error( $tag_obj->name );
41
 
42
  if ( 'captchac' == $tag_obj->type ) {
43
- if ( $image_sizes_array = preg_grep( '%^size:[smlSML]$%', $tag['options'] ) ) {
44
- $tag['options'] = array_values( array_diff_key( $tag['options'], $image_sizes_array ) );
45
  }
46
  $size = cf7bs_get_form_property( 'size', 0, $tag_obj );
47
  $image_size = 'large' == $size ? 'l' : ( 'small' == $size ? 's' : 'm' );
48
- $tag['options'][] = 'size:' . $image_size;
49
 
50
  $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
51
- 'name' => function_exists( 'wpcf7_captcha_form_tag_handler' ) ? wpcf7_captcha_form_tag_handler( $tag ) : wpcf7_captcha_shortcode_handler( $tag ),
52
  'type' => 'custom',
53
  'label' => $tag_obj->content,
54
  'help_text' => $validation_error,
@@ -97,7 +108,7 @@ function cf7bs_captcha_shortcode_handler( $tag ) {
97
 
98
  $tag = cf7bs_captchar_to_captchac( $tag );
99
 
100
- $$captchac_mode = function_exists( 'wpcf7_captcha_form_tag_handler' ) ? wpcf7_captcha_form_tag_handler( $tag ) : wpcf7_captcha_shortcode_handler( $tag );
101
  }
102
 
103
  $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
@@ -134,20 +145,26 @@ function cf7bs_captcha_shortcode_handler( $tag ) {
134
  }
135
 
136
  function cf7bs_captchar_to_captchac( $tag ) {
137
- $tag['type'] = 'captchac';
138
- $tag['basetype'] = 'captchac';
139
- $tag['options'] = array();
 
 
 
140
 
141
  $size = cf7bs_get_form_property( 'size' );
142
  $image_size = 'large' == $size ? 'l' : ( 'small' == $size ? 's' : 'm' );
143
- $tag['options'][] = 'size:' . $image_size;
144
 
145
  return $tag;
146
  }
147
 
148
  function cf7bs_captchar_has_captchac( $tag ) {
 
 
 
149
  $pattern = sprintf( '/^%s(:.+)?$/i', preg_quote( 'include_captchac', '/' ) );
150
- return (bool) preg_grep( $pattern, $tag['options'] );
151
  }
152
 
153
  add_filter( 'wpcf7_ajax_onload', 'cf7bs_captcha_ajax_refill', 11 );
21
  call_user_func( $remove_func, $tag );
22
  }
23
 
24
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
25
+ 'name-attr' => true,
26
+ );
27
+
28
+ call_user_func( $add_func, 'captchac', 'cf7bs_captcha_shortcode_handler', true );
29
+
30
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
31
+ 'name-attr' => true,
32
+ 'do-not-store' => true,
33
+ );
34
+
35
+ call_user_func( $add_func, 'captchar', 'cf7bs_captcha_shortcode_handler', true );
36
  }
37
 
38
  function cf7bs_captcha_shortcode_handler( $tag ) {
51
  $validation_error = wpcf7_get_validation_error( $tag_obj->name );
52
 
53
  if ( 'captchac' == $tag_obj->type ) {
54
+ if ( $image_sizes_array = preg_grep( '%^size:[smlSML]$%', $tag_obj->options ) ) {
55
+ $tag_obj->options = array_values( array_diff_key( $tag_obj->options, $image_sizes_array ) );
56
  }
57
  $size = cf7bs_get_form_property( 'size', 0, $tag_obj );
58
  $image_size = 'large' == $size ? 'l' : ( 'small' == $size ? 's' : 'm' );
59
+ $tag_obj->options[] = 'size:' . $image_size;
60
 
61
  $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
62
+ 'name' => function_exists( 'wpcf7_captchac_form_tag_handler' ) ? wpcf7_captchac_form_tag_handler( $tag ) : ( function_exists( 'wpcf7_captcha_form_tag_handler' ) ? wpcf7_captcha_form_tag_handler( $tag ) : wpcf7_captcha_shortcode_handler( $tag ) ),
63
  'type' => 'custom',
64
  'label' => $tag_obj->content,
65
  'help_text' => $validation_error,
108
 
109
  $tag = cf7bs_captchar_to_captchac( $tag );
110
 
111
+ $$captchac_mode = function_exists( 'wpcf7_captchar_form_tag_handler' ) ? wpcf7_captchar_form_tag_handler( $tag ) : ( function_exists( 'wpcf7_captcha_form_tag_handler' ) ? wpcf7_captcha_form_tag_handler( $tag ) : wpcf7_captcha_shortcode_handler( $tag ) );
112
  }
113
 
114
  $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
145
  }
146
 
147
  function cf7bs_captchar_to_captchac( $tag ) {
148
+ $classname = class_exists( 'WPCF7_FormTag' ) ? 'WPCF7_FormTag' : 'WPCF7_Shortcode';
149
+ $tag_obj = new $classname( $tag );
150
+
151
+ $tag_obj->type = 'captchac';
152
+ $tag_obj->basetype = 'captchac';
153
+ $tag_obj->options = array();
154
 
155
  $size = cf7bs_get_form_property( 'size' );
156
  $image_size = 'large' == $size ? 'l' : ( 'small' == $size ? 's' : 'm' );
157
+ $tag_obj->options[] = 'size:' . $image_size;
158
 
159
  return $tag;
160
  }
161
 
162
  function cf7bs_captchar_has_captchac( $tag ) {
163
+ $classname = class_exists( 'WPCF7_FormTag' ) ? 'WPCF7_FormTag' : 'WPCF7_Shortcode';
164
+ $tag_obj = new $classname( $tag );
165
+
166
  $pattern = sprintf( '/^%s(:.+)?$/i', preg_quote( 'include_captchac', '/' ) );
167
+ return (bool) preg_grep( $pattern, $tag_obj->options );
168
  }
169
 
170
  add_filter( 'wpcf7_ajax_onload', 'cf7bs_captcha_ajax_refill', 11 );
modules/recaptcha.php CHANGED
@@ -24,7 +24,11 @@ if ( function_exists( 'wpcf7_recaptcha_add_shortcode_recaptcha' ) ) {
24
  call_user_func( $remove_func, $tag );
25
  }
26
 
27
- call_user_func( $add_func, $tags, 'cf7bs_recaptcha_shortcode_handler' );
 
 
 
 
28
  }
29
  }
30
 
24
  call_user_func( $remove_func, $tag );
25
  }
26
 
27
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? false : array(
28
+ 'display-block' => true,
29
+ );
30
+
31
+ call_user_func( $add_func, $tags, 'cf7bs_recaptcha_shortcode_handler', $features );
32
  }
33
  }
34
 
modules/select.php CHANGED
@@ -21,7 +21,12 @@ function cf7bs_add_shortcode_select() {
21
  call_user_func( $remove_func, $tag );
22
  }
23
 
24
- call_user_func( $add_func, $tags, 'cf7bs_select_shortcode_handler', true );
 
 
 
 
 
25
  }
26
 
27
  function cf7bs_select_shortcode_handler( $tag ) {
21
  call_user_func( $remove_func, $tag );
22
  }
23
 
24
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
25
+ 'name-attr' => true,
26
+ 'selectable-values' => true,
27
+ );
28
+
29
+ call_user_func( $add_func, $tags, 'cf7bs_select_shortcode_handler', $features );
30
  }
31
 
32
  function cf7bs_select_shortcode_handler( $tag ) {
modules/text.php CHANGED
@@ -27,7 +27,11 @@ function cf7bs_add_shortcode_text() {
27
  call_user_func( $remove_func, $tag );
28
  }
29
 
30
- call_user_func( $add_func, $tags, 'cf7bs_text_shortcode_handler', true );
 
 
 
 
31
  }
32
 
33
  function cf7bs_text_shortcode_handler( $tag ) {
@@ -171,12 +175,15 @@ function cf7bs_text_shortcode_handler( $tag ) {
171
  }
172
 
173
  function cf7bs_text_to_count( $tag, $count_down = false ) {
174
- $tag['type'] = 'count';
175
- $tag['basetype'] = 'count';
176
- $tag['options'] = array();
 
 
 
177
 
178
  if ( $count_down ) {
179
- $tag['options'][] = 'down';
180
  }
181
 
182
  return $tag;
27
  call_user_func( $remove_func, $tag );
28
  }
29
 
30
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
31
+ 'name-attr' => true,
32
+ );
33
+
34
+ call_user_func( $add_func, $tags, 'cf7bs_text_shortcode_handler', $features );
35
  }
36
 
37
  function cf7bs_text_shortcode_handler( $tag ) {
175
  }
176
 
177
  function cf7bs_text_to_count( $tag, $count_down = false ) {
178
+ $classname = class_exists( 'WPCF7_FormTag' ) ? 'WPCF7_FormTag' : 'WPCF7_Shortcode';
179
+ $tag_obj = new $classname( $tag );
180
+
181
+ $tag_obj->type = 'count';
182
+ $tag_obj->basetype = 'count';
183
+ $tag_obj->options = array();
184
 
185
  if ( $count_down ) {
186
+ $tag_obj->options[] = 'down';
187
  }
188
 
189
  return $tag;
modules/textarea.php CHANGED
@@ -21,7 +21,11 @@ function cf7bs_add_shortcode_textarea() {
21
  call_user_func( $remove_func, $tag );
22
  }
23
 
24
- call_user_func( $add_func, $tags, 'cf7bs_textarea_shortcode_handler', true );
 
 
 
 
25
  }
26
 
27
  function cf7bs_textarea_shortcode_handler( $tag ) {
@@ -168,12 +172,15 @@ function cf7bs_textarea_shortcode_handler( $tag ) {
168
  }
169
 
170
  function cf7bs_textarea_to_count( $tag, $count_down = false ) {
171
- $tag['type'] = 'count';
172
- $tag['basetype'] = 'count';
173
- $tag['options'] = array();
 
 
 
174
 
175
  if ( $count_down ) {
176
- $tag['options'][] = 'down';
177
  }
178
 
179
  return $tag;
21
  call_user_func( $remove_func, $tag );
22
  }
23
 
24
+ $features = version_compare( WPCF7_VERSION, '4.7', '<' ) ? true : array(
25
+ 'name-attr' => true,
26
+ );
27
+
28
+ call_user_func( $add_func, $tags, 'cf7bs_textarea_shortcode_handler', $features );
29
  }
30
 
31
  function cf7bs_textarea_shortcode_handler( $tag ) {
172
  }
173
 
174
  function cf7bs_textarea_to_count( $tag, $count_down = false ) {
175
+ $classname = class_exists( 'WPCF7_FormTag' ) ? 'WPCF7_FormTag' : 'WPCF7_Shortcode';
176
+ $tag_obj = new $classname( $tag );
177
+
178
+ $tag_obj->type = 'count';
179
+ $tag_obj->basetype = 'count';
180
+ $tag_obj->options = array();
181
 
182
  if ( $count_down ) {
183
+ $tag_obj->options[] = 'down';
184
  }
185
 
186
  return $tag;
readme.txt CHANGED
@@ -7,9 +7,9 @@ Author URI: https://leaves-and-love.net
7
  Contributors: flixos90
8
  Donate link: https://leaves-and-love.net/wordpress-plugins/
9
  Requires at least: 3.6
10
- Tested up to: 4.7
11
- Stable tag: 1.4.2
12
- Version: 1.4.2
13
  License: GNU General Public License v3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
  Tags: contact form 7, wpcf7, bootstrap, bootstrap 3, bootstrap framework, addon, contact form 7 addon, contact form, cf7bs
@@ -111,6 +111,11 @@ You can also contribute to the plugin by translating it. Simply visit [translate
111
 
112
  == Changelog ==
113
 
 
 
 
 
 
114
  = 1.4.2 =
115
  * Fixed: plugin compatibility fatal errors with Contact Form 7 version 4.6 with count and CAPTCHA shortcodes
116
 
7
  Contributors: flixos90
8
  Donate link: https://leaves-and-love.net/wordpress-plugins/
9
  Requires at least: 3.6
10
+ Tested up to: 4.8
11
+ Stable tag: 1.4.3
12
+ Version: 1.4.3
13
  License: GNU General Public License v3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
  Tags: contact form 7, wpcf7, bootstrap, bootstrap 3, bootstrap framework, addon, contact form 7 addon, contact form, cf7bs
111
 
112
  == Changelog ==
113
 
114
+ = 1.4.3 =
115
+ * Fixed: plugin compatibility fatal errors with Contact Form 7 version 4.8 related to form validation and REALLY SIMPLE CAPTCHA
116
+ * Fixed: Contact Form 7 version 4.7 features are now being used
117
+ * Fixed: correct styles for latest Contact Form 7 versions are now being printed
118
+
119
  = 1.4.2 =
120
  * Fixed: plugin compatibility fatal errors with Contact Form 7 version 4.6 with count and CAPTCHA shortcodes
121