Bootstrap for Contact Form 7 - Version 1.2.3

Version Description

  • Enhanced: Arguments for every field are now filtered to allow detailed adjustments
Download this release

Release Info

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

Code changes from version 1.2.2 to 1.2.3

assets/scripts.min.js CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * Bootstrap for Contact Form 7 Scripts - Version 1.2.2
3
  *
4
  * Modifications and Additions to WPCF7 Scripts to work with CF7BS
5
  * Felix Arntz <felix-arntz@leaves-and-love.net>
1
  /*!
2
+ * Bootstrap for Contact Form 7 Scripts - Version 1.2.3
3
  *
4
  * Modifications and Additions to WPCF7 Scripts to work with CF7BS
5
  * Felix Arntz <felix-arntz@leaves-and-love.net>
bootstrap-for-contact-form-7.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Bootstrap for Contact Form 7
4
  Plugin URI: http://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.2.2
7
  Author: Felix Arntz
8
  Author URI: http://leaves-and-love.net
9
  License: GNU General Public License v2
@@ -11,11 +11,11 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  */
12
  /**
13
  * @package CF7BS
14
- * @version 1.2.2
15
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
16
  */
17
 
18
- define( 'CF7BS_VERSION', '1.2.2' );
19
  define( 'CF7BS_MAINFILE', __FILE__ );
20
  define( 'CF7BS_PATH', untrailingslashit( plugin_dir_path( CF7BS_MAINFILE ) ) );
21
  define( 'CF7BS_URL', untrailingslashit( plugin_dir_url( CF7BS_MAINFILE ) ) );
@@ -64,19 +64,24 @@ $current_form_properties = array();
64
  function cf7bs_get_form_property( $property, $form_id = 0 ) {
65
  global $current_form_id, $current_form_properties;
66
 
67
- if ( $form_id == 0 ) {
68
- if ( is_callable( array( 'WPCF7_ContactForm', 'get_current' ) ) ) {
69
- $current_form = WPCF7_ContactForm::get_current();
70
- if ( is_a( $current_form, 'WPCF7_ContactForm' ) && is_callable( array( $current_form, 'id' ) ) ) {
71
- $form_id = $current_form->id();
 
 
 
 
 
 
 
 
 
72
  }
73
  }
74
  }
75
 
76
- if ( $form_id == 0 ) {
77
- return false;
78
- }
79
-
80
  if ( $current_form_id != $form_id ) {
81
  $current_form_id = $form_id;
82
 
@@ -94,6 +99,12 @@ function cf7bs_get_form_property( $property, $form_id = 0 ) {
94
  $current_form_properties = apply_filters( 'cf7bs_form_' . $form_id . '_properties', $properties );
95
  }
96
 
 
 
 
 
 
 
97
  if ( isset( $current_form_properties[ $property ] ) ) {
98
  return $current_form_properties[ $property ];
99
  }
@@ -116,6 +127,14 @@ function cf7bs_get_default_form_properties() {
116
  return apply_filters( 'cf7bs_default_form_properties', $properties );
117
  }
118
 
 
 
 
 
 
 
 
 
119
  function cf7bs_add_get_parameter() {
120
  $args = func_get_args();
121
  if ( is_array( $args[0] ) ) {
@@ -141,3 +160,14 @@ function cf7bs_add_get_parameter() {
141
  }
142
  return '';
143
  }
 
 
 
 
 
 
 
 
 
 
 
3
  Plugin Name: Bootstrap for Contact Form 7
4
  Plugin URI: http://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.2.3
7
  Author: Felix Arntz
8
  Author URI: http://leaves-and-love.net
9
  License: GNU General Public License v2
11
  */
12
  /**
13
  * @package CF7BS
14
+ * @version 1.2.3
15
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
16
  */
17
 
18
+ define( 'CF7BS_VERSION', '1.2.3' );
19
  define( 'CF7BS_MAINFILE', __FILE__ );
20
  define( 'CF7BS_PATH', untrailingslashit( plugin_dir_path( CF7BS_MAINFILE ) ) );
21
  define( 'CF7BS_URL', untrailingslashit( plugin_dir_url( CF7BS_MAINFILE ) ) );
64
  function cf7bs_get_form_property( $property, $form_id = 0 ) {
65
  global $current_form_id, $current_form_properties;
66
 
67
+ $current_form = $original_form = null;
68
+
69
+ if ( ! $form_id ) {
70
+ $form_id = cf7bs_get_current_form_id();
71
+ if ( ! $form_id ) {
72
+ return false;
73
+ }
74
+ $current_form = WPCF7_ContactForm::get_current();
75
+ } else {
76
+ $current_form = WPCF7_ContactForm::get_instance( $form_id );
77
+ $original_form = WPCF7_ContactForm::get_current();
78
+ if ( is_a( $current_form, 'WPCF7_ContactForm' ) && is_callable( array( $current_form, 'id' ) ) && is_a( $original_form, 'WPCF7_ContactForm' ) && is_callable( array( $original_form, 'id' ) ) ) {
79
+ if ( $original_form->id() === $current_form->id() ) {
80
+ $original_form = null;
81
  }
82
  }
83
  }
84
 
 
 
 
 
85
  if ( $current_form_id != $form_id ) {
86
  $current_form_id = $form_id;
87
 
99
  $current_form_properties = apply_filters( 'cf7bs_form_' . $form_id . '_properties', $properties );
100
  }
101
 
102
+ if ( null !== $original_form ) {
103
+ if ( is_a( $original_form, 'WPCF7_ContactForm' ) && is_callable( array( $original_form, 'id' ) ) ) {
104
+ WPCF7_ContactForm::get_instance( $original_form->id() );
105
+ }
106
+ }
107
+
108
  if ( isset( $current_form_properties[ $property ] ) ) {
109
  return $current_form_properties[ $property ];
110
  }
127
  return apply_filters( 'cf7bs_default_form_properties', $properties );
128
  }
129
 
130
+ function cf7bs_apply_field_args_filter( $field_args, $tag_type, $tag_name, $form_id = 0 ) {
131
+ if ( ! $form_id ) {
132
+ $form_id = cf7bs_get_current_form_id();
133
+ }
134
+
135
+ return apply_filters( 'cf7bs_form_' . $form_id . '_field_' . $tag_type . '_' . $tag_name . '_properties', $field_args );
136
+ }
137
+
138
  function cf7bs_add_get_parameter() {
139
  $args = func_get_args();
140
  if ( is_array( $args[0] ) ) {
160
  }
161
  return '';
162
  }
163
+
164
+ function cf7bs_get_current_form_id() {
165
+ if ( is_callable( array( 'WPCF7_ContactForm', 'get_current' ) ) ) {
166
+ $current_form = WPCF7_ContactForm::get_current();
167
+ if ( is_a( $current_form, 'WPCF7_ContactForm' ) && is_callable( array( $current_form, 'id' ) ) ) {
168
+ return $current_form->id();
169
+ }
170
+ }
171
+
172
+ return false;
173
+ }
changelog.txt CHANGED
@@ -1,5 +1,8 @@
1
  == Changelog ==
2
 
 
 
 
3
  = 1.2.2 =
4
  * Fixed: CSS is now specific to the contact form to prevent conflicts
5
 
1
  == Changelog ==
2
 
3
+ = 1.2.3 =
4
+ * Enhanced: Arguments for every field are now filtered to allow detailed adjustments
5
+
6
  = 1.2.2 =
7
  * Fixed: CSS is now specific to the contact form to prevent conflicts
8
 
classes/CF7BS_Alert.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
classes/CF7BS_Button.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
classes/CF7BS_Button_Group.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
classes/CF7BS_Component.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
classes/CF7BS_Form_Field.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
composer.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "name": "felixarntz/bootstrap-for-contact-form-7",
3
  "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.",
4
- "version": "1.2.2",
5
  "license": "GPL-2.0",
6
  "type": "wordpress-plugin",
7
  "keywords": [
1
  {
2
  "name": "felixarntz/bootstrap-for-contact-form-7",
3
  "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.",
4
+ "version": "1.2.3",
5
  "license": "GPL-2.0",
6
  "type": "wordpress-plugin",
7
  "keywords": [
modifications.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
modules/acceptance.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
@@ -32,7 +32,7 @@ function cf7bs_acceptance_shortcode_handler( $tag ) {
32
  $class .= ' wpcf7-invert';
33
  }
34
 
35
- $field = new CF7BS_Form_Field( array(
36
  'name' => $tag->name,
37
  'id' => $tag->get_option( 'id', 'id', true ),
38
  'class' => $tag->get_class_option( $class ),
@@ -52,7 +52,7 @@ function cf7bs_acceptance_shortcode_handler( $tag ) {
52
  'status' => $status,
53
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
54
  'wrapper_class' => $tag->name,
55
- ) );
56
 
57
  $html = $field->display( false );
58
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
32
  $class .= ' wpcf7-invert';
33
  }
34
 
35
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
36
  'name' => $tag->name,
37
  'id' => $tag->get_option( 'id', 'id', true ),
38
  'class' => $tag->get_class_option( $class ),
52
  'status' => $status,
53
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
54
  'wrapper_class' => $tag->name,
55
+ ), $tag->basetype, $tag->name ) );
56
 
57
  $html = $field->display( false );
58
 
modules/captcha.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
@@ -36,7 +36,7 @@ function cf7bs_captcha_shortcode_handler( $tag ) {
36
  $image_size = 'large' == $size ? 'l' : ( 'small' == $size ? 's' : 'm' );
37
  $tag['options'][] = 'size:' . $image_size;
38
 
39
- $field = new CF7BS_Form_Field( array(
40
  'name' => wpcf7_captcha_shortcode_handler( $tag ),
41
  'type' => 'custom',
42
  'label' => $tag_obj->content,
@@ -47,7 +47,7 @@ function cf7bs_captcha_shortcode_handler( $tag ) {
47
  'form_breakpoint' => cf7bs_get_form_property( 'breakpoint' ),
48
  'tabindex' => false,
49
  'wrapper_class' => '',
50
- ) );
51
 
52
  $html = $field->display( false );
53
 
@@ -89,7 +89,7 @@ function cf7bs_captcha_shortcode_handler( $tag ) {
89
  $$captchac_mode = wpcf7_captcha_shortcode_handler( $tag );
90
  }
91
 
92
- $field = new CF7BS_Form_Field( array(
93
  'name' => $tag_obj->name,
94
  'id' => $tag_obj->get_option( 'id', 'id', true ),
95
  'class' => $tag_obj->get_class_option( $class ),
@@ -111,7 +111,7 @@ function cf7bs_captcha_shortcode_handler( $tag ) {
111
  'input_after' => $input_after,
112
  'input_before_class'=> 'input-group-addon input-group-has-image',
113
  'input_after_class' => 'input-group-addon input-group-has-image',
114
- ) );
115
 
116
  $html = $field->display( false );
117
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
36
  $image_size = 'large' == $size ? 'l' : ( 'small' == $size ? 's' : 'm' );
37
  $tag['options'][] = 'size:' . $image_size;
38
 
39
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
40
  'name' => wpcf7_captcha_shortcode_handler( $tag ),
41
  'type' => 'custom',
42
  'label' => $tag_obj->content,
47
  'form_breakpoint' => cf7bs_get_form_property( 'breakpoint' ),
48
  'tabindex' => false,
49
  'wrapper_class' => '',
50
+ ), $tag_obj->basetype, $tag_obj->name ) );
51
 
52
  $html = $field->display( false );
53
 
89
  $$captchac_mode = wpcf7_captcha_shortcode_handler( $tag );
90
  }
91
 
92
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
93
  'name' => $tag_obj->name,
94
  'id' => $tag_obj->get_option( 'id', 'id', true ),
95
  'class' => $tag_obj->get_class_option( $class ),
111
  'input_after' => $input_after,
112
  'input_before_class'=> 'input-group-addon input-group-has-image',
113
  'input_after_class' => 'input-group-addon input-group-has-image',
114
+ ), $tag_obj->basetype, $tag_obj->name ) );
115
 
116
  $html = $field->display( false );
117
 
modules/checkbox.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
@@ -148,7 +148,7 @@ function cf7bs_checkbox_shortcode_handler( $tag ) {
148
  }
149
  }
150
 
151
- $field = new CF7BS_Form_Field( array(
152
  'name' => $tag->name,
153
  'id' => $tag->get_option( 'id', 'id', true ),
154
  'class' => '',
@@ -168,7 +168,7 @@ function cf7bs_checkbox_shortcode_handler( $tag ) {
168
  'status' => $status,
169
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
170
  'wrapper_class' => $tag->get_class_option( $class . ' ' . $tag->name ),
171
- ) );
172
 
173
  $html = $field->display( false );
174
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
148
  }
149
  }
150
 
151
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
152
  'name' => $tag->name,
153
  'id' => $tag->get_option( 'id', 'id', true ),
154
  'class' => '',
168
  'status' => $status,
169
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
170
  'wrapper_class' => $tag->get_class_option( $class . ' ' . $tag->name ),
171
+ ), $tag->basetype, $tag->name ) );
172
 
173
  $html = $field->display( false );
174
 
modules/count.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
@@ -19,7 +19,7 @@ function cf7bs_count_shortcode_handler( $tag ) {
19
  return '';
20
  }
21
 
22
- $field = new CF7BS_Form_Field( array(
23
  'name' => wpcf7_count_shortcode_handler( $tag ),
24
  'type' => 'custom',
25
  'label' => $tag_obj->content,
@@ -29,7 +29,7 @@ function cf7bs_count_shortcode_handler( $tag ) {
29
  'form_breakpoint' => cf7bs_get_form_property( 'breakpoint' ),
30
  'tabindex' => false,
31
  'wrapper_class' => '',
32
- ) );
33
 
34
  $html = $field->display( false );
35
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
19
  return '';
20
  }
21
 
22
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
23
  'name' => wpcf7_count_shortcode_handler( $tag ),
24
  'type' => 'custom',
25
  'label' => $tag_obj->content,
29
  'form_breakpoint' => cf7bs_get_form_property( 'breakpoint' ),
30
  'tabindex' => false,
31
  'wrapper_class' => '',
32
+ ), $tag_obj->basetype, $tag_obj->name ) );
33
 
34
  $html = $field->display( false );
35
 
modules/date.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
@@ -50,7 +50,7 @@ function cf7bs_date_shortcode_handler( $tag ) {
50
  $value = stripslashes_deep( rawurldecode( $_GET[ $tag->name ] ) );
51
  }
52
 
53
- $field = new CF7BS_Form_Field( array(
54
  'name' => $tag->name,
55
  'id' => $tag->get_option( 'id', 'id', true ),
56
  'class' => $tag->get_class_option( $class ),
@@ -74,7 +74,7 @@ function cf7bs_date_shortcode_handler( $tag ) {
74
  'readonly' => $tag->has_option( 'readonly' ) ? true : false,
75
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
76
  'wrapper_class' => $tag->name,
77
- ) );
78
 
79
  $html = $field->display( false );
80
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
50
  $value = stripslashes_deep( rawurldecode( $_GET[ $tag->name ] ) );
51
  }
52
 
53
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
54
  'name' => $tag->name,
55
  'id' => $tag->get_option( 'id', 'id', true ),
56
  'class' => $tag->get_class_option( $class ),
74
  'readonly' => $tag->has_option( 'readonly' ) ? true : false,
75
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
76
  'wrapper_class' => $tag->name,
77
+ ), $tag->basetype, $tag->name ) );
78
 
79
  $html = $field->display( false );
80
 
modules/file.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
@@ -51,7 +51,7 @@ function cf7bs_file_shortcode_handler( $tag ) {
51
  $value = stripslashes_deep( $_POST[$tag->name] );
52
  }
53
 
54
- $field = new CF7BS_Form_Field( array(
55
  'name' => $tag->name,
56
  'id' => $tag->get_option( 'id', 'id', true ),
57
  'class' => $tag->get_class_option( $class ),
@@ -68,7 +68,7 @@ function cf7bs_file_shortcode_handler( $tag ) {
68
  'status' => $status,
69
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
70
  'wrapper_class' => $tag->name,
71
- ) );
72
 
73
  $html = $field->display( false );
74
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
51
  $value = stripslashes_deep( $_POST[$tag->name] );
52
  }
53
 
54
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
55
  'name' => $tag->name,
56
  'id' => $tag->get_option( 'id', 'id', true ),
57
  'class' => $tag->get_class_option( $class ),
68
  'status' => $status,
69
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
70
  'wrapper_class' => $tag->name,
71
+ ), $tag->basetype, $tag->name ) );
72
 
73
  $html = $field->display( false );
74
 
modules/number.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
@@ -52,7 +52,7 @@ function cf7bs_number_shortcode_handler( $tag ) {
52
  $value = stripslashes_deep( rawurldecode( $_GET[ $tag->name ] ) );
53
  }
54
 
55
- $field = new CF7BS_Form_Field( array(
56
  'name' => $tag->name,
57
  'id' => $tag->get_option( 'id', 'id', true ),
58
  'class' => $tag->get_class_option( $class ),
@@ -76,7 +76,7 @@ function cf7bs_number_shortcode_handler( $tag ) {
76
  'readonly' => $tag->has_option( 'readonly' ) ? true : false,
77
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
78
  'wrapper_class' => $tag->name,
79
- ) );
80
 
81
  $html = $field->display( false );
82
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
52
  $value = stripslashes_deep( rawurldecode( $_GET[ $tag->name ] ) );
53
  }
54
 
55
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
56
  'name' => $tag->name,
57
  'id' => $tag->get_option( 'id', 'id', true ),
58
  'class' => $tag->get_class_option( $class ),
76
  'readonly' => $tag->has_option( 'readonly' ) ? true : false,
77
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
78
  'wrapper_class' => $tag->name,
79
+ ), $tag->basetype, $tag->name ) );
80
 
81
  $html = $field->display( false );
82
 
modules/quiz.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
@@ -44,7 +44,7 @@ function cf7bs_quiz_shortcode_handler( $tag ) {
44
  }
45
  $answer = wpcf7_canonicalize( $answer );
46
 
47
- $field = new CF7BS_Form_Field( array(
48
  'name' => $tag->name,
49
  'id' => $tag->get_option( 'id', 'id', true ),
50
  'class' => $tag->get_class_option( $class ),
@@ -62,7 +62,7 @@ function cf7bs_quiz_shortcode_handler( $tag ) {
62
  'maxlength' => $tag->get_maxlength_option(),
63
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
64
  'wrapper_class' => $tag->name,
65
- ) );
66
 
67
  $html = $field->display( false );
68
  $hidden_html = sprintf( '<input type="hidden" name="_wpcf7_quiz_answer_%1$s" value="%2$s">', $tag->name, wp_hash( $answer, 'wpcf7_quiz' ) );
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
44
  }
45
  $answer = wpcf7_canonicalize( $answer );
46
 
47
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
48
  'name' => $tag->name,
49
  'id' => $tag->get_option( 'id', 'id', true ),
50
  'class' => $tag->get_class_option( $class ),
62
  'maxlength' => $tag->get_maxlength_option(),
63
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
64
  'wrapper_class' => $tag->name,
65
+ ), $tag->basetype, $tag->name ) );
66
 
67
  $html = $field->display( false );
68
  $hidden_html = sprintf( '<input type="hidden" name="_wpcf7_quiz_answer_%1$s" value="%2$s">', $tag->name, wp_hash( $answer, 'wpcf7_quiz' ) );
modules/select.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
@@ -107,7 +107,7 @@ function cf7bs_select_shortcode_handler( $tag ) {
107
  }
108
  }
109
 
110
- $field = new CF7BS_Form_Field( array(
111
  'name' => $tag->name,
112
  'id' => $tag->get_option( 'id', 'id', true ),
113
  'class' => $tag->get_class_option( $class ),
@@ -125,7 +125,7 @@ function cf7bs_select_shortcode_handler( $tag ) {
125
  'status' => $status,
126
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
127
  'wrapper_class' => $tag->name,
128
- ) );
129
 
130
  $html = $field->display( false );
131
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
107
  }
108
  }
109
 
110
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
111
  'name' => $tag->name,
112
  'id' => $tag->get_option( 'id', 'id', true ),
113
  'class' => $tag->get_class_option( $class ),
125
  'status' => $status,
126
  'tabindex' => $tag->get_option( 'tabindex', 'int', true ),
127
  'wrapper_class' => $tag->name,
128
+ ), $tag->basetype, $tag->name ) );
129
 
130
  $html = $field->display( false );
131
 
modules/submit.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
modules/text.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
@@ -107,7 +107,7 @@ function cf7bs_text_shortcode_handler( $tag ) {
107
  }
108
  }
109
 
110
- $field = new CF7BS_Form_Field( array(
111
  'name' => $tag_obj->name,
112
  'id' => $tag_obj->get_option( 'id', 'id', true ),
113
  'class' => $tag_obj->get_class_option( $class ),
@@ -130,7 +130,7 @@ function cf7bs_text_shortcode_handler( $tag ) {
130
  'wrapper_class' => $tag_obj->name,
131
  'input_before' => $input_before,
132
  'input_after' => $input_after,
133
- ) );
134
 
135
  $html = $field->display( false );
136
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
107
  }
108
  }
109
 
110
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
111
  'name' => $tag_obj->name,
112
  'id' => $tag_obj->get_option( 'id', 'id', true ),
113
  'class' => $tag_obj->get_class_option( $class ),
130
  'wrapper_class' => $tag_obj->name,
131
  'input_before' => $input_before,
132
  'input_after' => $input_after,
133
+ ), $tag_obj->basetype, $tag_obj->name ) );
134
 
135
  $html = $field->display( false );
136
 
modules/textarea.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package CF7BS
4
- * @version 1.2.2
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
@@ -102,7 +102,7 @@ function cf7bs_textarea_shortcode_handler( $tag ) {
102
  }
103
  }
104
 
105
- $field = new CF7BS_Form_Field( array(
106
  'name' => $tag_obj->name,
107
  'id' => $tag_obj->get_option( 'id', 'id', true ),
108
  'class' => $tag_obj->get_class_option( $class ),
@@ -126,7 +126,7 @@ function cf7bs_textarea_shortcode_handler( $tag ) {
126
  'rows' => $rows,
127
  'input_before' => $input_before,
128
  'input_after' => $input_after,
129
- ) );
130
 
131
  $html = $field->display( false );
132
 
1
  <?php
2
  /**
3
  * @package CF7BS
4
+ * @version 1.2.3
5
  * @author Felix Arntz <felix-arntz@leaves-and-love.net>
6
  */
7
 
102
  }
103
  }
104
 
105
+ $field = new CF7BS_Form_Field( cf7bs_apply_field_args_filter( array(
106
  'name' => $tag_obj->name,
107
  'id' => $tag_obj->get_option( 'id', 'id', true ),
108
  'class' => $tag_obj->get_class_option( $class ),
126
  'rows' => $rows,
127
  'input_before' => $input_before,
128
  'input_after' => $input_after,
129
+ ), $tag_obj->basetype, $tag_obj->name ) );
130
 
131
  $html = $field->display( false );
132
 
package.json CHANGED
@@ -1,7 +1,7 @@
1
  {
2
  "name": "bootstrap-for-contact-form-7",
3
  "pluginName": "Bootstrap for Contact Form 7",
4
- "version": "1.2.2",
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
  "keywords": [
7
  "wordpress", "plugin", "contact form 7", "wpcf7", "bootstrap", "bootstrap 3", "bootstrap framework", "addon", "contact form 7 addon", "contact form", "cf7bs", "css"
1
  {
2
  "name": "bootstrap-for-contact-form-7",
3
  "pluginName": "Bootstrap for Contact Form 7",
4
+ "version": "1.2.3",
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
  "keywords": [
7
  "wordpress", "plugin", "contact form 7", "wpcf7", "bootstrap", "bootstrap 3", "bootstrap framework", "addon", "contact form 7 addon", "contact form", "cf7bs", "css"
readme.txt CHANGED
@@ -7,9 +7,9 @@ Author: Felix Arntz
7
  Donate link: http://leaves-and-love.net/wordpress-plugins/
8
  Contributors: flixos90
9
  Requires at least: 3.6
10
- Tested up to: 4.2
11
- Stable tag: 1.2.2
12
- Version: 1.2.2
13
  License: GPL v2
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
  Tags: contact form 7, wpcf7, bootstrap, bootstrap 3, bootstrap framework, addon, css framework, contact form 7 addon, contact form, cf7bs, css
@@ -109,6 +109,9 @@ If you're a developer and you have some ideas to improve the plugin or to solve
109
 
110
  == Changelog ==
111
 
 
 
 
112
  = 1.2.2 =
113
  * Fixed: CSS is now specific to the contact form to prevent conflicts
114
 
@@ -230,6 +233,10 @@ You can add GET parameters to populate your forms with custom initial values by
230
  'your-subject' => 'Support Request',
231
  ), 'http://www.example.com/my-custom-form/' );
232
 
 
 
 
 
233
  == Unsupported functionality ==
234
 
235
  While the plugin tries to support as many features as possible from the original Contact Form 7 (in combination with adding new ones!), not everything is and can be supported.
7
  Donate link: http://leaves-and-love.net/wordpress-plugins/
8
  Contributors: flixos90
9
  Requires at least: 3.6
10
+ Tested up to: 4.3
11
+ Stable tag: 1.2.3
12
+ Version: 1.2.3
13
  License: GPL v2
14
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
15
  Tags: contact form 7, wpcf7, bootstrap, bootstrap 3, bootstrap framework, addon, css framework, contact form 7 addon, contact form, cf7bs, css
109
 
110
  == Changelog ==
111
 
112
+ = 1.2.3 =
113
+ * Enhanced: Arguments for every field are now filtered to allow detailed adjustments
114
+
115
  = 1.2.2 =
116
  * Fixed: CSS is now specific to the contact form to prevent conflicts
117
 
233
  'your-subject' => 'Support Request',
234
  ), 'http://www.example.com/my-custom-form/' );
235
 
236
+ = Filter Field Arguments =
237
+
238
+ As of version 1.2.3, field arguments for every single field can be filtered, which allows you to basically modify anything you like. The filters you need to hook your function into have the following structure `cf7bs_form_{{FORM_ID}}_field_{{FIELD_BASETYPE}}_{{FIELD_NAME}}_properties`. Yep, it's a long filter name, but it is necessary so that you can filter in the most detailed way possible. When using one of the filters, replace `{{FORM_ID}}` with the ID of the form, `{{FIELD_BASETYPE}}` with the type of the field you need to adjust (be sure to not include the asterisks here!) and `{{FIELD_NAME}}` with the name of the field. The function should accept one argument, an array of parameters. For an overview about the available parameters, please check the plugin's source code.
239
+
240
  == Unsupported functionality ==
241
 
242
  While the plugin tries to support as many features as possible from the original Contact Form 7 (in combination with adding new ones!), not everything is and can be supported.