PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.13.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.13.0
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
ablocks / addons / theme-builder / theme-builder.php

theme-builder.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.13.0, at addons/theme-builder/theme-builder.php

58 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ABlocksThemeBuilder;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 use ABlocks\Interfaces\AddonInterface;
10
11 final class ThemeBuilder implements AddonInterface {
12 private $addon_name = 'theme-builder';
13 private function __construct() {
14 $this->define_constants();
15 $this->init_addon();
16 }
17
18 public function define_constants() {
19 /**
20 * Defines CONSTANTS for Whole Addon.
21 */
22 define( 'ABLOCKS_THEME_BUILDER_VERSION', '1.0' );
23 define( 'ABLOCKS_THEME_BUILDER_ADDON_NAME', $this->addon_name );
24 }
25
26 public function init_addon() {
27 // fire addon activation hook
28 add_action( "ablocks/addons/activated_{$this->addon_name}", array( $this, 'addon_activation_hook' ) );
29 // if disable then stop running addon
30 if ( ! \ABlocks\Helper::get_addon_active_status( $this->addon_name ) ) {
31 return;
32 }
33
34 database::init();
35 CompatibilityManager::init();
36 Assets::init();
37 ( new Ajax\Posts() )->dispatch_actions();
38 Shortcode::init();
39 if ( ! is_admin() ) {
40 Frontend::init();
41 }
42 }
43
44 public static function init() {
45 static $instance = false;
46
47 if ( ! $instance ) {
48 $instance = new self();
49 }
50
51 return $instance;
52 }
53
54 public function addon_activation_hook() {
55
56 }
57 }
58