# slider-blocks/1.0.0/includes/RegisterBlocks/RegisterBlocks.php

GutSlider – All in One Slider and Carousel Blocks for Gutenberg, version 1.0.0. 46 lines.

- Page: https://pluginprobe.com/plugins/slider-blocks/1.0.0/code/includes/RegisterBlocks/RegisterBlocks.php
- Raw: https://pluginprobe.com/plugins/slider-blocks/1.0.0/raw/includes/RegisterBlocks/RegisterBlocks.php
- Modified: 2023-09-21T13:58:18+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/slider-blocks/1.0.0/code/includes/RegisterBlocks/RegisterBlocks.php#L10-L20`.

```php
<?php
/**
 * Register All Blocks 
 */

namespace GutSliders\RegisterBlocks;

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

class RegisterBlocks {

    /**
     * Constructor
     */
    public function __construct() {
        add_action( 'init', [ $this, 'register_blocks' ] );
    }

    /**
     * Register Blocks
     */
    public function register_blocks() {
        $blocksList = [
            [
                'name' => 'content-slider',
            ]
        ];
        
        // register blocks
        if( ! empty( $blocksList ) ) {
            foreach( $blocksList as $block ) {
                register_block_type(
                    GUTSLIDERS_PATH . '/build/blocks/' . $block['name'],
                    isset( $block['render_callback'] ) ?
                    [
                        'render_callback' => $block['render_callback']
                    ] : []
                );
            }
        }
    }

}
```
