# filebird/6.3/includes/Blocks/BlockController.php

FileBird – WordPress Media Library Folders &amp; File Manager, version 6.3. 31 lines.

- Page: https://pluginprobe.com/plugins/filebird/6.3/code/includes/Blocks/BlockController.php
- Raw: https://pluginprobe.com/plugins/filebird/6.3/raw/includes/Blocks/BlockController.php
- Modified: 2024-06-25T07:35:42+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/filebird/6.3/code/includes/Blocks/BlockController.php#L10-L20`.

```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();
        }
    }
}
```
