-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.php
47 lines (37 loc) · 1.24 KB
/
plugin.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
46
47
<?php
/*
* Plugin Name: Mindworks WordPress Blocks
* Description: A simple WordPress Plugin to create a simple custom Gutenberg Block.
* Author: Ayo Reis
* Author URI: //ayoreis.com/
* Version 1.0.0
* Requires at least: 5.0.0
*/
function my_register_block_types() {
wp_register_script(
'build/index.js',
plugins_url( 'build/index.js', __FILE__ ), //plugin dir path
array('wp-blocks', 'wp-editor', 'wp-element', 'wp-components')
);
// wp_register_style(
// 'styles.css',
// plugins_url('/styles.css', __FILE__),
// array()
// );
register_block_type('blocks/name', array(
'api_version' => 2,
'editor_script' => 'build/index.js'
// 'editor_style => 'uri'
// 'style' => 'styles.css'
));
register_block_type('blocks/block-side-note', array(
'api_version' => 2,
'editor_script' => 'build/index.js'
));
register_block_type('blocks/block-get-posts', array(
'api_version' => 2,
'editor_script' => 'build/index.js'
));
}
add_action('init', 'my_register_block_types');
?>