# ablocks/2.9.1/addons/theme-builder/theme-builder.php

aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder &amp; Animation Builder, version 2.9.1. 55 lines.

- Page: https://pluginprobe.com/plugins/ablocks/2.9.1/code/addons/theme-builder/theme-builder.php
- Raw: https://pluginprobe.com/plugins/ablocks/2.9.1/raw/addons/theme-builder/theme-builder.php
- Modified: 2025-04-22T12:59:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/ablocks/2.9.1/code/addons/theme-builder/theme-builder.php#L10-L20`.

```php
<?php

namespace ABlocksThemeBuilder;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

use ABlocks\Interfaces\AddonInterface;

final class ThemeBuilder implements AddonInterface {
	private $addon_name = 'theme-builder';
	private function __construct() {
		$this->define_constants();
		$this->init_addon();
	}

	public function define_constants() {
		/**
		 * Defines CONSTANTS for Whole Addon.
		 */
		define( 'ABLOCKS_THEME_BUILDER_VERSION', '1.0' );
		define( 'ABLOCKS_THEME_BUILDER_ADDON_NAME', $this->addon_name );
	}

	public function init_addon() {
		// fire addon activation hook
		add_action( "ablocks/addons/activated_{$this->addon_name}", array( $this, 'addon_activation_hook' ) );
		// if disable then stop running addon
		if ( ! \ABlocks\Helper::get_addon_active_status( $this->addon_name ) ) {
			return;
		}

		database::init();
		CompatibilityManager::init();
		Assets::init();
		( new Ajax\Posts() )->dispatch_actions();
		Shortcode::init();
	}

	public static function init() {
		static $instance = false;

		if ( ! $instance ) {
			$instance = new self();
		}

		return $instance;
	}

	public function addon_activation_hook() {

	}
}

```
