Contact Form7 Widget For Elementor Page Builder - Version 1.0.0

Version Description

Download this release

Release Info

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

Version 1.0.0

assets/banner-772x250.jpg ADDED
Binary file
assets/icon-128x128.png ADDED
Binary file
assets/screenshot-1.jpg ADDED
Binary file
assets/screenshot-2.jpg ADDED
Binary file
assets/screenshot-3.jpg ADDED
Binary file
helper/helper.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! function_exists( 'get_contact_form_7_posts' ) ) :
4
+
5
+ function get_contact_form_7_posts(){
6
+
7
+ $args = array('post_type' => 'wpcf7_contact_form', 'posts_per_page' => -1);
8
+
9
+ $catlist=[];
10
+
11
+ if( $categories = get_posts($args)){
12
+ foreach ( $categories as $category ) {
13
+ (int)$catlist[$category->ID] = $category->post_title;
14
+ }
15
+ }
16
+ else{
17
+ (int)$catlist['0'] = esc_html__('No contect From 7 form found', 'void');
18
+ }
19
+ return $catlist;
20
+ }
21
+
22
+ endif;
plugin.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace voidelement; //main namespace
3
+
4
+ global $void_cf7;
5
+ $void_cf7= array_map('basename', glob(dirname( __FILE__ ) . '/widgets/*.php'));
6
+
7
+ use voidelement\Widgets\void_cf7; //path define same as class name of the widget
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
10
+
11
+
12
+ // Add a custom category for panel widgets
13
+ add_action( 'elementor/init', function() {
14
+ \Elementor\Plugin::$instance->elements_manager->add_category(
15
+ 'void-elements', // the name of the category
16
+ [
17
+ 'title' => esc_html__( 'VOID ELEMENTS', 'void' ),
18
+ 'icon' => 'fa fa-header', //default icon
19
+ ],
20
+ 1 // position
21
+ );
22
+ } );
23
+
24
+
25
+
26
+ /**
27
+ * Main Plugin Class
28
+ *
29
+ * Register new elementor widget.
30
+ *
31
+ * @since 1.0.0
32
+ */
33
+ class Plugin {
34
+
35
+ /**
36
+ * Constructor
37
+ *
38
+ * @since 1.0.0
39
+ *
40
+ * @access public
41
+ */
42
+
43
+ public function __construct() {
44
+ $this->add_actions();
45
+ }
46
+
47
+ /**
48
+ * Add Actions
49
+ *
50
+ * @since 1.0.0
51
+ *
52
+ * @access private
53
+ */
54
+ private function add_actions() {
55
+ add_action( 'elementor/widgets/widgets_registered', [ $this, 'on_widgets_registered' ] );
56
+
57
+ }
58
+
59
+ /**
60
+ * On Widgets Registered
61
+ *
62
+ * @since 1.0.0
63
+ *
64
+ * @access public
65
+ */
66
+ public function on_widgets_registered() {
67
+ $this->includes();
68
+ $this->register_widget();
69
+ }
70
+
71
+ /**
72
+ * Includes
73
+ *
74
+ * @since 1.0.0
75
+ *
76
+ * @access private
77
+ */
78
+ private function includes() {
79
+ global $void_cf7; //include the widgets here
80
+ require __DIR__ . '/helper/helper.php';
81
+ foreach($void_cf7 as $key => $value){
82
+ require __DIR__ . '/widgets/'.$value;
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Register Widget
88
+ *
89
+ * @since 1.0.0
90
+ *
91
+ * @access private
92
+ */
93
+ private function register_widget() {
94
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new void_cf7() );
95
+ }
96
+ }
97
+
98
+ new Plugin();
readme.txt ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Contact Form7 Widget For Elementor Page Builder ===
2
+ 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
6
+ Stable tag: 1.0.0
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).
22
+ For updates follow us on : [Facebook](https://www.facebook.com/voidthemes).
23
+
24
+
25
+ [youtube https://youtu.be/sAHspWvhjNg]
26
+
27
+
28
+ 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
+
32
+ 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
33
+
34
+ == Installation ==
35
+
36
+ 1. Upload the plugin folder after extracting it to the "/wp-content/plugins/(the folder of the extracted plugin)" directory, or install the plugin through the WordPress plugins screen directly.
37
+ 2. Activate the plugin through the 'Plugins' screen in WordPress
38
+ 3. Go to elementor page builder mode and then select our post grid widget and you will see many options when you drag and drop the widget to the live page. To see the real preview in live mode you must click apply button on top to update the layout and finally hit save in elementor and visit your page to see the changes.
39
+
40
+
41
+ == Frequently Asked Questions ==
42
+
43
+ = Where can to find the new element added =
44
+
45
+ Our Contact Form7 Widget For Elementor Page Builder adds a new section in the elementor live page builder named : VOID ELEMENTS. There you will see the widget which you can drag and drop and config settings
46
+
47
+
48
+ == Screenshots ==
49
+
50
+ 1. /assets/screenshot-1.jpg
51
+ 2. /assets/screenshot-2.jpg
52
+ 3. /assets/screenshot-3.jpg
53
+
54
+
55
+
56
+ == Changelog ==
57
+ = 1.0 =
58
+ * Initial Launch
void-cf7-widget-elementor.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
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.0
6
+ * Author: VOID THEMES
7
+ * Plugin URI: http://voidthemes.com/contact-form-7-widget-for-elementor/
8
+ * Author URI: http://voidthemes.com
9
+ * Text Domain: void
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
+
14
+
15
+ function void_cf7_widget() {
16
+ // Load localization file
17
+ load_plugin_textdomain( 'void' );
18
+
19
+ // Notice if the Elementor is not active
20
+ if ( ! did_action( 'elementor/loaded' ) ) {
21
+ return;
22
+ }
23
+
24
+ // Check version required
25
+ $elementor_version_required = '1.0.0';
26
+ if ( ! version_compare( ELEMENTOR_VERSION, $elementor_version_required, '>=' ) ) {
27
+ return;
28
+ }
29
+
30
+ // Require the main plugin file
31
+ require( __DIR__ . '/plugin.php' ); //loading the main plugin
32
+
33
+ }
34
+ add_action( 'plugins_loaded', 'void_cf7_widget' );
35
+
36
+ // display custom admin notice
37
+ function void_cf7_widget_notice() { ?>
38
+
39
+ <?php if (!did_action( 'elementor/loaded' ) || !is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) : ?>
40
+ <div class="notice notice-warning is-dismissible">
41
+ <p><?php echo sprintf( __( '<a href="%s" target="_blank" >Elementor Page Builder</a> and <a href="%s" target="_blank" >Contact Form 7</a> must be installed and activated for "Contact Form 7 Widget For Elementor Page Builder" to work' ), 'https://wordpress.org/plugins/elementor/', 'https://wordpress.org/plugins/contact-form-7/'); ?></p>
42
+ </div>
43
+ <?php endif; ?>
44
+
45
+ <?php }
46
+ add_action('admin_notices', 'void_cf7_widget_notice');
widgets/void-section-cf7.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace voidelement\Widgets;
3
+
4
+ use Elementor\Widget_Base;
5
+ use Elementor\Controls_Manager;
6
+ use Elementor\Group_Control_Image_Size;
7
+ use Elementor\Utils;
8
+
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
+
12
+ /**
13
+ * Elementor Style for header
14
+ *
15
+ *
16
+ * @since 1.0.0
17
+ */
18
+
19
+ class void_cf7 extends Widget_Base { //this name is added to plugin.php of the root folder
20
+
21
+ public function get_name() {
22
+ return 'void-section-cf7';
23
+ }
24
+
25
+ public function get_title() {
26
+ return 'Void Contact From 7'; // title to show on elementor
27
+ }
28
+
29
+ public function get_icon() {
30
+ return 'eicon-mail'; // eicon-posts-ticker-> eicon ow asche icon to show on elelmentor
31
+ }
32
+
33
+ public function get_categories() {
34
+ return [ 'void-elements' ]; // category of the widget
35
+ }
36
+
37
+ /**
38
+ * A list of scripts that the widgets is depended in
39
+ * @since 1.3.0
40
+ **/
41
+ protected function _register_controls() {
42
+
43
+ //start of a control box
44
+ $this->start_controls_section(
45
+ 'section_content',
46
+ [
47
+ 'label' => esc_html__( 'Contact Form 7', 'void' ), //section name for controler view
48
+ ]
49
+ );
50
+
51
+ $this->add_control(
52
+ 'cf7',
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
+ );
60
+
61
+ $this->end_controls_section();
62
+ }
63
+
64
+
65
+ protected function render() { //to show on the fontend
66
+ $settings = $this->get_settings();
67
+ if(!empty($settings['cf7'])){
68
+ echo'<div class="elementor-shortcode">';
69
+ echo do_shortcode('[contact-form-7 id="'.$settings['cf7'].'"]');
70
+ echo '</div>';
71
+ }
72
+ }
73
+ }
74
+