PluginProbe
GutSlider – All in One Slider and Carousel Blocks for Gutenberg / 1.0.0
GutSlider – All in One Slider and Carousel Blocks for Gutenberg v1.0.0
3.2.0 3.1.0 3.0.0 2.13.2 2.13.1 2.13.0 trunk 1.0.0 2.1.0 2.10.0 2.10.1 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.12.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.1 2.5.3 2.5.4 2.5.5 All 57 releases
slider-blocks / includes / RegisterBlocks / RegisterBlocks.php

RegisterBlocks.php in GutSlider – All in One Slider and Carousel Blocks for Gutenberg 1.0.0, at includes/RegisterBlocks/RegisterBlocks.php

46 lines 960 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Register All Blocks
4 */
5
6 namespace GutSliders\RegisterBlocks;
7
8 // Exit if accessed directly.
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 class RegisterBlocks {
14
15 /**
16 * Constructor
17 */
18 public function __construct() {
19 add_action( 'init', [ $this, 'register_blocks' ] );
20 }
21
22 /**
23 * Register Blocks
24 */
25 public function register_blocks() {
26 $blocksList = [
27 [
28 'name' => 'content-slider',
29 ]
30 ];
31
32 // register blocks
33 if( ! empty( $blocksList ) ) {
34 foreach( $blocksList as $block ) {
35 register_block_type(
36 GUTSLIDERS_PATH . '/build/blocks/' . $block['name'],
37 isset( $block['render_callback'] ) ?
38 [
39 'render_callback' => $block['render_callback']
40 ] : []
41 );
42 }
43 }
44 }
45
46 }