allow_gateways = apply_filters( 'jet-form-builder/allow-gateways', false ); $this->maybe_enable_gateways(); $this->admin_bar = \Jet_Admin_Bar::get_instance(); $this->post_type = new Post_Type(); $this->blocks = new Blocks\Manager(); $this->actions = new Actions\Manager(); $this->form = new Form_Manager(); $this->form_handler = new Form_Handler(); $this->captcha = new Forms_Captcha(); $this->license_manager = new LicenseManager(); Dev_Mode\Manager::instance(); File_Upload::instance(); new Elementor_Controller(); if ( is_admin() ) { $this->editor = new Admin\Editor(); new Form_Actions_Manager(); new Pages_Manager( array( new Settings_Page(), new Addons_Page() ) ); } } public function init_framework() { require $this->plugin_dir( 'framework/loader.php' ); $this->framework = new CX_Loader( array( $this->plugin_dir( 'framework/vue-ui/cherry-x-vue-ui.php' ), $this->plugin_dir( 'framework/admin-bar/jet-admin-bar.php' ), ) ); } public function maybe_enable_gateways() { Tab_Handler_Manager::instance()->tab( 'payments-gateways' )->save_global_options(); $gateways = Tab_Handler_Manager::instance()->tab( 'payments-gateways' )->get_global_options(); if ( isset( $gateways['enable_test_mode'] ) ) { add_filter( 'jet-form-builder/gateways/paypal/sandbox-mode', function () use ( $gateways ) { return $gateways['enable_test_mode']; } ); } if ( isset( $gateways['use_gateways'] ) ) { $this->allow_gateways = $gateways['use_gateways']; } } /** * Returns url to file or dir inside plugin folder * * @param string $path Path inside plugin dir. * * @return string */ public function plugin_url( $path = null ) { return JET_FORM_BUILDER_URL . $path; } public function plugin_dir( $path = '' ) { return JET_FORM_BUILDER_PATH . $path; } /** * Returns plugin version */ public function get_version() { return JET_FORM_BUILDER_VERSION; } /** * Plugin constructor. */ private function __construct() { $this->register_autoloader(); add_action( 'after_setup_theme', function () { do_action( 'jet-form-builder/before-init' ); $this->init_components(); do_action( 'jet-form-builder/after-init' ); }, 0 ); $this->init_framework(); } } Plugin::instance();