* @link https://www.fireplugins.com * @copyright Copyright © 2021 FirePlugins All Rights Reserved * @license GNU GPLv3 or later */ namespace FireBox\Core; if (!defined('ABSPATH')) { exit; // Exit if accessed directly. } class Blocks { public function __construct() { $this->init(); } /** * Initialize all blocks * * @return void */ public function init() { $blocks = \scandir(dirname(__FILE__) . '/Blocks'); foreach ($blocks as $block_file_name) { if (!$ext = pathinfo($block_file_name, PATHINFO_EXTENSION)) { continue; } $class = '\FireBox\Core\Blocks\\' . basename($block_file_name, '.php'); if (!class_exists($class)) { continue; } new $class(); } } }