HEX
Server: Apache
System: Linux 244.240.109.208.host.secureserver.net 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64
User: icsla (1002)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/icsla/public_html/wp-content/plugins/popup-maker/classes/Controllers/WP/Blocks.php
<?php
/**
 * Blocks registration.
 *
 * @author    Code Atlantic
 * @package   PopupMaker
 * @copyright (c) 2024, Code Atlantic LLC.
 */

namespace PopupMaker\Controllers\WP;

use PopupMaker\Plugin\Controller;

defined( 'ABSPATH' ) || exit;

/**
 * Class Blocks
 *
 * @since 1.21.0
 */
class Blocks extends Controller {

	/**
	 * Initializes this module.
	 */
	public function init() {
		add_action( 'init', [ $this, 'register_blocks' ] );
	}

	/**
	 * Register Popup Maker blocks.
	 *
	 * @return void
	 */
	public function register_blocks() {
		$blocks = [
			'dist/blocks/cta-buttons.block.json' => [],
			'dist/blocks/cta-button.block.json' => [],
		];

		foreach( $blocks as $block => $args ) {
			register_block_type_from_metadata(
				$this->container->get_path( $block ),
				$args
			);
		}
	}
}