PluginProbe
JetFormBuilder — Dynamic Blocks Form Builder / 1.0.2
JetFormBuilder — Dynamic Blocks Form Builder v1.0.2
3.6.5.2 3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 All 130 releases
jetformbuilder / includes / plugin.php
plugin.php
121 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Jet_Form_Builder;
4
5 // If this file is called directly, abort.
6 use Jet_Form_Builder\Classes\Frontend_Helper;
7 use Jet_Form_Builder\Integrations\Forms_Captcha;
8
9 if ( ! defined( 'WPINC' ) ) {
10 die;
11 }
12
13 /**
14 * Main file
15 */
16 class Plugin {
17
18 /**
19 * Instance.
20 *
21 * Holds the plugin instance.
22 *
23 * @since 1.0.0
24 * @access public
25 * @static
26 *
27 * @var Plugin
28 */
29 public static $instance = null;
30
31 public $post_type;
32 public $blocks;
33 public $actions;
34 public $form;
35 public $form_handler;
36 public $editor;
37 public $captcha;
38
39 public $is_activated_jet_sm;
40
41 /**
42 * Instance.
43 *
44 * Ensures only one instance of the plugin class is loaded or can be loaded.
45 *
46 * @return Plugin An instance of the class.
47 * @since 1.0.0
48 * @access public
49 * @static
50 *
51 */
52 public static function instance() {
53
54 if ( is_null( self::$instance ) ) {
55 self::$instance = new self();
56 }
57
58 return self::$instance;
59 }
60
61 /**
62 * Register autoloader.
63 */
64 private function register_autoloader() {
65 require JET_FORM_BUILDER_PATH . 'includes' . DIRECTORY_SEPARATOR . 'autoloader.php';
66 Autoloader::run();
67 }
68
69 /**
70 * Initialize plugin parts
71 *
72 * @return void
73 */
74 public function init_components() {
75
76 $this->post_type = new Post_Type();
77 $this->blocks = new Blocks\Manager();
78 $this->actions = new Actions\Manager();
79 $this->form = new Form_Manager();
80 $this->form_handler = new Form_Handler();
81 $this->captcha = new Forms_Captcha();
82
83 File_Upload::instance();
84
85 if ( is_admin() ) {
86 $this->editor = new Admin\Editor();
87 }
88 }
89
90 /**
91 * Returns url to file or dir inside plugin folder
92 *
93 * @param string $path Path inside plugin dir.
94 *
95 * @return string
96 */
97 public function plugin_url( $path = null ) {
98 return JET_FORM_BUILDER_URL . $path;
99 }
100
101 /**
102 * Returns plugin version
103 */
104 public function get_version() {
105 return JET_FORM_BUILDER_VERSION;
106 }
107
108 /**
109 * Plugin constructor.
110 */
111 private function __construct() {
112
113 $this->register_autoloader();
114
115 add_action( 'after_setup_theme', array( $this, 'init_components' ), 0 );
116 }
117
118 }
119
120 Plugin::instance();
121