-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
45 lines (36 loc) · 965 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Plugin Name: JS-Advancers-Gutenberg-Boilerplate
* Description:
* Version: 1.0.0
* Author: JS-Advancers
* Text Domain: js_advancers_gb_boilerplate
*
*/
add_action( 'init', 'register_block_assets' );
function register_block_assets() {
// register the main JS file that houses all our blocks
wp_register_script(
'block-js',
plugins_url( '/build/index.js' , __FILE__ ),
['wp-blocks']
);
// register our block styles
wp_register_style(
'block-style',
plugins_url( '/style.css' , __FILE__ ),
[]
);
// register our editor styles
wp_register_style(
'block-editor-style',
plugins_url( '/editor.css' , __FILE__ ),
[]
);
// register our block
register_block_type( 'jsadvancers/basic-block', array(
'editor_script' => 'block-js',
'editor_style' => 'block-editor-style',
'style' => 'block-style'
));
}