Contact Form7 Widget For Elementor Page Builder - Version 1.0.2

Version Description

  • Define Any page as thank you page
  • More Comporftable Select2 for selecting Contact From
Download this release

Release Info

Developer voidthemes
Plugin Icon 128x128 Contact Form7 Widget For Elementor Page Builder
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

assets/css/void-cf7-admin.css ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* void cf7 admin css */
2
+
3
+ .void-cf7-review{
4
+ background : #FFFFFF ;
5
+ padding : 10px;
6
+ margin-top : 40px;
7
+ margin-bottom: 10px;
8
+ line-height: 1.5;
9
+ font-size: 16px;
10
+ border-left: 5px solid #006799;
11
+ -webkit-box-shadow: 1px 1px 1px 1px #d3d3d3;
12
+ box-shadow: 1px 1px 1px 1px #d3d3d3;
13
+ }
14
+ .void-cf7-review-btn{
15
+ padding-top: 5px;
16
+ }
17
+ .void-cf7-review-done{
18
+ float: right;
19
+ text-decoration: none;
20
+ }
helper/helper.php CHANGED
@@ -20,3 +20,25 @@ if ( ! function_exists( 'get_contact_form_7_posts' ) ) :
20
  }
21
 
22
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }
21
 
22
  endif;
23
+
24
+ if ( ! function_exists( 'void_get_all_pages' ) ) :
25
+
26
+ function void_get_all_pages(){
27
+
28
+ $args = array('post_type' => 'page', 'posts_per_page' => -1);
29
+
30
+ $catlist=[];
31
+
32
+ if( $categories = get_posts($args)){
33
+ foreach ( $categories as $category ) {
34
+ (int)$catlist[$category->ID] = $category->post_title;
35
+ }
36
+ }
37
+ else{
38
+ (int)$catlist['0'] = esc_html__('No Pages Found!', 'void');
39
+ }
40
+ return $catlist;
41
+ }
42
+
43
+ endif;
44
+
readme.txt CHANGED
@@ -3,19 +3,23 @@ Contributors: voidthemes
3
  Tags: page-builder, elementor, cf7, contact-form-7, contact-form-7 widget, widget, elementor add on, email, contact,form
4
  Requires at least: 4.4
5
  Tested up to: 4.8.1
6
- Stable tag: 1.0.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
- This WordPress Plugin Adds Contact Form 7 widget element to Elementor page builder for easy drag & drop the created contact forms with CF7 (contact form 7).
 
11
  You must have [Elementor Page Builder](https://wordpress.org/plugins/elementor/) installed.
12
  You must have [Contact form 7](https://wordpress.org/plugins/contact-form-7/) installed and forms created.
13
  == Description ==
14
 
15
  This plugin adds new element / widget to Elementor Page Builder which helps you to easily drag and drop contact form 7 forms from a drop down list. No need of going in cf7 & copying the shortcode and addding to shortcode widget of elementor anymore !!
16
 
17
- Now only Drag and drop the widget inside elementor builder & choose your contact form ! Done !
18
-
 
 
 
19
 
20
  For more details :[VOID CF7 Elementor Widget](http://voidthemes.com/contact-form-7-widget-for-elementor/).
21
  For our other elementor & WP works visit : [VOID Themes](http://voidthemes.com).
@@ -29,6 +33,8 @@ What Does This plugin give you?
29
 
30
  1. Easy use of contact forms created with Contact form 7 pluing inside elementor live editor
31
  2. Add Css directly from elementor live preview to your contact form 7 for different field type!!
 
 
32
 
33
  Note: This plugin is an addon of Elementor Page Builder (https://wordpress.org/plugins/elementor/) and will only work with Elementor Page Builder installed. And your elementor should be up to date to latest version
34
 
@@ -55,6 +61,9 @@ Our Contact Form7 Widget For Elementor Page Builder adds a new section in the el
55
 
56
 
57
  == Changelog ==
 
 
 
58
  = 1.0.1 =
59
  * Custom CSS Adding option
60
  = 1.0.0 =
3
  Tags: page-builder, elementor, cf7, contact-form-7, contact-form-7 widget, widget, elementor add on, email, contact,form
4
  Requires at least: 4.4
5
  Tested up to: 4.8.1
6
+ Stable tag: 1.0.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
10
+ This WordPress Plugin Adds Contact Form 7 widget element to Elementor page builder for easy drag & drop the created contact forms with CF7 (contact form 7). It also lets you define any page as a thank you / success page after the form has been submitted! You also can add basic custom CSS directly from elementor edit screen now !!
11
+
12
  You must have [Elementor Page Builder](https://wordpress.org/plugins/elementor/) installed.
13
  You must have [Contact form 7](https://wordpress.org/plugins/contact-form-7/) installed and forms created.
14
  == Description ==
15
 
16
  This plugin adds new element / widget to Elementor Page Builder which helps you to easily drag and drop contact form 7 forms from a drop down list. No need of going in cf7 & copying the shortcode and addding to shortcode widget of elementor anymore !!
17
 
18
+ * Now only Drag and drop the widget inside elementor builder & choose your contact form ! Done !
19
+ * Want to define style for input, lable, send button, success ? No problem ! This plugin let's you do those directly from elementor screen!
20
+ * Want to add custom page to redirect to when the form is submitted ? That is also possible now !
21
+ Yet this is just a simple plugin for simple users :)
22
+ * What's more interesting is that you can have multiple form of the same single contact form 7 form with different rules and design with this on same page !
23
 
24
  For more details :[VOID CF7 Elementor Widget](http://voidthemes.com/contact-form-7-widget-for-elementor/).
25
  For our other elementor & WP works visit : [VOID Themes](http://voidthemes.com).
33
 
34
  1. Easy use of contact forms created with Contact form 7 pluing inside elementor live editor
35
  2. Add Css directly from elementor live preview to your contact form 7 for different field type!!
36
+ 3. Add any wordpress page as thank you page with this directly from elementor edit screen when you add the VOID Contact Fom 7 Widget!
37
+ 4. Use Single contact form 7 with different Style & redirect rule(Thank you page on success) on the same page with this.
38
 
39
  Note: This plugin is an addon of Elementor Page Builder (https://wordpress.org/plugins/elementor/) and will only work with Elementor Page Builder installed. And your elementor should be up to date to latest version
40
 
61
 
62
 
63
  == Changelog ==
64
+ = 1.0.2 =
65
+ * Define Any page as thank you page
66
+ * More Comporftable Select2 for selecting Contact From
67
  = 1.0.1 =
68
  * Custom CSS Adding option
69
  = 1.0.0 =
void-cf7-widget-elementor.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Contact Form 7 Widget For Elementor Page Builder
4
  * Description: Adds Contact Form 7 widget element to Elementor page builder for easy drag & drop the created contact forms with CF7 (contact form 7).
5
- * Version: 1.0.1
6
  * Author: VOID THEMES
7
  * Plugin URI: http://voidthemes.com/contact-form-7-widget-for-elementor/
8
  * Author URI: http://voidthemes.com
2
  /**
3
  * Plugin Name: Contact Form 7 Widget For Elementor Page Builder
4
  * Description: Adds Contact Form 7 widget element to Elementor page builder for easy drag & drop the created contact forms with CF7 (contact form 7).
5
+ * Version: 1.0.2
6
  * Author: VOID THEMES
7
  * Plugin URI: http://voidthemes.com/contact-form-7-widget-for-elementor/
8
  * Author URI: http://voidthemes.com
widgets/void-section-cf7.php CHANGED
@@ -53,7 +53,8 @@ protected function _register_controls() {
53
  [
54
  'label' => esc_html__( 'Select Contact Form', 'void' ),
55
  'description' => esc_html__('Contact form 7 - plugin must be installed and there must be some contact forms made with the contact form 7','void'),
56
- 'type' => Controls_Manager::SELECT,
 
57
  'options' => get_contact_form_7_posts(),
58
  ]
59
  );
@@ -188,16 +189,51 @@ protected function _register_controls() {
188
 
189
 
190
  $this->end_controls_section();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  }
192
 
193
 
194
  protected function render() { //to show on the fontend
 
 
195
  $settings = $this->get_settings();
196
  if(!empty($settings['cf7'])){
197
- echo'<div class="elementor-shortcode void-cf7">';
198
  echo do_shortcode('[contact-form-7 id="'.$settings['cf7'].'"]');
199
  echo '</div>';
200
  }
 
 
 
 
 
 
 
 
 
 
 
 
201
  }
202
  }
203
-
53
  [
54
  'label' => esc_html__( 'Select Contact Form', 'void' ),
55
  'description' => esc_html__('Contact form 7 - plugin must be installed and there must be some contact forms made with the contact form 7','void'),
56
+ 'type' => Controls_Manager::SELECT2,
57
+ 'multiple' => false,
58
  'options' => get_contact_form_7_posts(),
59
  ]
60
  );
189
 
190
 
191
  $this->end_controls_section();
192
+
193
+
194
+
195
+ $this->start_controls_section(
196
+ 'section_redirect',
197
+ [
198
+ 'label' => esc_html__( 'After Submit Redirect Setting', 'void' ), //section name for controler view
199
+ ]
200
+ );
201
+
202
+ $this->add_control(
203
+ 'cf7_redirect_page',
204
+ [
205
+ 'label' => esc_html__( 'On Success Redirect To', 'void' ),
206
+ 'description' => esc_html__('Select a page which you want users to redirect to when the contact fom is submitted and is successful. Leave Blank to Disable','void'),
207
+ 'type' => Controls_Manager::SELECT2,
208
+ 'multiple' => false,
209
+ 'options' => void_get_all_pages(),
210
+ ]
211
+ );
212
+
213
+ $this->end_controls_section();
214
  }
215
 
216
 
217
  protected function render() { //to show on the fontend
218
+ static $v_veriable=0;
219
+
220
  $settings = $this->get_settings();
221
  if(!empty($settings['cf7'])){
222
+ echo'<div class="elementor-shortcode void-cf7-'.$v_veriable.'">';
223
  echo do_shortcode('[contact-form-7 id="'.$settings['cf7'].'"]');
224
  echo '</div>';
225
  }
226
+
227
+ if(!empty($settings['cf7_redirect_page'])) { ?>
228
+ <script>
229
+ var theform = document.querySelector('.void-cf7-<?php echo $v_veriable; ?>');
230
+ theform.addEventListener( 'wpcf7mailsent', function( event ) {
231
+ location = '<?php echo get_permalink( $settings['cf7_redirect_page'] ); ?>';
232
+ }, false );
233
+ </script>
234
+
235
+ <?php $v_veriable++;
236
+ }
237
+
238
  }
239
  }