Contact Form for WordPress – Ultimate Form Builder Lite - Version 1.4.7

Version Description

  • Added widget Integration
Download this release

Release Info

Developer Access Keys
Plugin Icon 128x128 Contact Form for WordPress – Ultimate Form Builder Lite
Version 1.4.7
Comparing to
See all releases

Code changes from version 1.4.6 to 1.4.7

inc/cores/widgets.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class ufbl_Widget extends WP_Widget {
4
+
5
+ public function __construct() {
6
+ $widget_ops = array(
7
+ 'classname' => 'ufbl_widget',
8
+ 'description' => 'Ultimate Form Builder Lite - Widget',
9
+ );
10
+ parent::__construct('ufbl_widget', 'Ultimate Form Builder Lite', $widget_ops);
11
+ }
12
+
13
+ public function form($instance) {
14
+
15
+ // outputs the options form on admin
16
+
17
+ $title = isset($instance['title'])?$instance['title']:'';
18
+
19
+ $form_id = isset($instance['form_id'])?$instance['form_id']:'';
20
+
21
+ ?>
22
+ <p>
23
+ <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_attr_e('Title:', 'ultimate-form-builder-lite'); ?></label>
24
+
25
+ <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>">
26
+
27
+ <label for="<?php echo esc_attr($this->get_field_id('form_id')); ?>"><?php esc_attr_e('Choose form:', 'ultimate-form-builder-lite'); ?></label>
28
+ <br>
29
+
30
+ <?php
31
+
32
+ $args = array('post_type_page'=>'ufbl',
33
+ 'post_status'=>'publish',
34
+ 'posts_per_page'=>'25');
35
+ // The Query
36
+ $the_query = new WP_Query( $args );
37
+
38
+ // The Loop
39
+ if ( $the_query->have_posts() ) {
40
+ echo '<select class="widefat" name="'.esc_attr($this->get_field_name('form_id')).'">';
41
+ echo '<option value="">'.esc_html__('Select form','ufbl').'</option>';
42
+ while ( $the_query->have_posts() ) {
43
+ $the_query->the_post();
44
+ echo '<option';
45
+ if($form_id==get_the_ID()){
46
+ echo ' selected="selected"';
47
+ }
48
+ echo ' value="'.get_the_ID().'">' . get_the_title() . '</option>';
49
+ }
50
+ echo '</select>';
51
+ }
52
+ /* Restore original Post Data */
53
+ wp_reset_postdata();
54
+
55
+ ?>
56
+ </p>
57
+
58
+
59
+ <?php
60
+ }
61
+
62
+ public function widget($args, $instance) {
63
+ // outputs the content of the widget
64
+ echo $args[ 'before_widget' ];
65
+ if ( !empty($instance[ 'title' ]) ) {
66
+ echo $args[ 'before_title' ] . apply_filters('widget_title', $instance[ 'title' ]) . $args[ 'after_title' ];
67
+ }
68
+ $tid = $instance[ 'form_id' ];
69
+ $shtc = '[et id="'.$tid.'"]';
70
+ if (!empty ($tid) ){
71
+ echo do_shortcode($shtc);
72
+ }
73
+ echo $args[ 'after_widget' ];
74
+
75
+ }
76
+
77
+ public function update($new_instance, $old_instance) {
78
+ $instance = array();
79
+ $instance[ 'title' ] = (!empty($new_instance[ 'title' ]) ) ? sanitize_text_field($new_instance[ 'title' ]) : '';
80
+ $instance['form_id'] = (!empty($new_instance['form_id']) ) ? sanitize_text_field($new_instance['form_id']) : '';
81
+
82
+ return $instance;
83
+ }
84
+ }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: contact form, form builder, form, forms, contact forms, enquiry forms, for
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 4.5
6
  Tested up to: 5.5
7
- Stable tag: 1.4.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -147,6 +147,9 @@ Once you install the plugin , you can check some general documentation about how
147
  10. Backend Entry Detail
148
 
149
  == Changelog ==
 
 
 
150
  = 1.4.6 =
151
  * WordPress 5.5 compatibility checked
152
 
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 4.5
6
  Tested up to: 5.5
7
+ Stable tag: 1.4.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
147
  10. Backend Entry Detail
148
 
149
  == Changelog ==
150
+ = 1.4.7 =
151
+ * Added widget Integration
152
+
153
  = 1.4.6 =
154
  * WordPress 5.5 compatibility checked
155
 
ultimate-form-builder-lite.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ultimate Form Builder Lite
4
  Plugin URI: https://accesspressthemes.com/wordpress-plugins/ultimate-form-builder-lite/
5
  Description: A plugin to build any type of forms
6
- Version: 1.4.6
7
  Author: AccessPress Themes
8
  Author URI: http://accesspressthemes.com
9
  License: GPL2
@@ -16,7 +16,7 @@
16
  * Necessary Constants for plugin
17
  */
18
  global $wpdb;
19
- defined( 'UFBL_VERSION' ) or define( 'UFBL_VERSION', '1.4.6' ); //plugin version
20
  defined( 'UFBL_SLUG' ) or define( 'UFBL_SLUG', 'ufbl' ); //plugin admin slug
21
  defined( 'UFBL_TD' ) or define( 'UFBL_TD', 'ultimate-form-builder-lite' ); //plugin's text domain
22
  defined( 'UFBL_IMG_DIR' ) or define( 'UFBL_IMG_DIR', plugin_dir_url( __FILE__ ) . 'images' ); //plugin image directory
@@ -46,6 +46,8 @@ if ( !class_exists( 'UFBL_Class' ) ) {
46
  function __construct() {
47
  $this->library = new UFBL_Lib();
48
  $this->model = new UFBL_Model();
 
 
49
  add_action( 'init', array( $this, 'ufbl_init' ) ); //executes when init hook is fired
50
  add_action( 'admin_menu', array( $this, 'ufbl_menu' ) ); //adds plugin menu in wordpress backend
51
  add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_assets' ) ); //registers admin assets
@@ -112,7 +114,8 @@ if ( !class_exists( 'UFBL_Class' ) ) {
112
  add_action( 'template_redirect', array( $this, 'preview_form' ) );
113
  add_action( 'admin_init', array( $this, 'redirect_to_site' ), 1 );
114
  add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
115
- add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ) );
 
116
  }
117
 
118
  function admin_footer_text( $text ){
@@ -475,6 +478,16 @@ if ( !class_exists( 'UFBL_Class' ) ) {
475
  }
476
 
477
 
 
 
 
 
 
 
 
 
 
 
478
  }
479
 
480
  /**
3
  Plugin Name: Ultimate Form Builder Lite
4
  Plugin URI: https://accesspressthemes.com/wordpress-plugins/ultimate-form-builder-lite/
5
  Description: A plugin to build any type of forms
6
+ Version: 1.4.7
7
  Author: AccessPress Themes
8
  Author URI: http://accesspressthemes.com
9
  License: GPL2
16
  * Necessary Constants for plugin
17
  */
18
  global $wpdb;
19
+ defined( 'UFBL_VERSION' ) or define( 'UFBL_VERSION', '1.4.7' ); //plugin version
20
  defined( 'UFBL_SLUG' ) or define( 'UFBL_SLUG', 'ufbl' ); //plugin admin slug
21
  defined( 'UFBL_TD' ) or define( 'UFBL_TD', 'ultimate-form-builder-lite' ); //plugin's text domain
22
  defined( 'UFBL_IMG_DIR' ) or define( 'UFBL_IMG_DIR', plugin_dir_url( __FILE__ ) . 'images' ); //plugin image directory
46
  function __construct() {
47
  $this->library = new UFBL_Lib();
48
  $this->model = new UFBL_Model();
49
+ $this->includes();
50
+
51
  add_action( 'init', array( $this, 'ufbl_init' ) ); //executes when init hook is fired
52
  add_action( 'admin_menu', array( $this, 'ufbl_menu' ) ); //adds plugin menu in wordpress backend
53
  add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_assets' ) ); //registers admin assets
114
  add_action( 'template_redirect', array( $this, 'preview_form' ) );
115
  add_action( 'admin_init', array( $this, 'redirect_to_site' ), 1 );
116
  add_filter( 'plugin_row_meta', array( $this, 'plugin_row_meta' ), 10, 2 );
117
+ add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ) );
118
+ add_action( 'widgets_init', array($this, 'register_widget'));
119
  }
120
 
121
  function admin_footer_text( $text ){
478
  }
479
 
480
 
481
+
482
+ function includes() {
483
+ include(UFBL_PATH . 'inc/cores/widgets.php');
484
+ }
485
+
486
+ function register_widget() {
487
+ register_widget('ufbl_widget');
488
+ }
489
+
490
+
491
  }
492
 
493
  /**