HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: /home/mmickelson/martyknows.com/wp-content/plugins/filebird/includes/Blocks/BlockController.php
<?php

namespace FileBird\Blocks;

defined( 'ABSPATH' ) || exit;

final class BlockController {
    public function __construct() {
        if ( function_exists( 'register_block_type' ) ) {
            add_action( 'init', array( $this, 'register_blocks' ) );
        }
	}

    public function get_blocks() {
        $blocks = apply_filters(
            'fbv_blocks',
            array()
        );

        return $blocks;
    }

    public function register_blocks() {
        $blocks = $this->get_blocks();

        foreach ( $blocks as $block ) {
            $block_class = __NAMESPACE__ . "\\{$block}";
            new $block_class();
        }
    }
}