forked from Automattic/gutenberg-block-styles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
28 lines (21 loc) · 833 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
<?php
/**
* Plugin Name: Gutenberg Block Styles
* Plugin URI: https://github.com/audunmb/gutenberg-block-styles
* Description: A simple plugin to demonstrate how to add block styles to Gutenberg.
* Version: 1.2
* Author: audunmb
*/
/* Register the javascript file that for the block styles */
function customblockstyles_editor_assets() {
wp_enqueue_script( 'custom-block-styles-script', plugins_url( 'custom-block-styles.js', __FILE__ ),
array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' ),
);
}
add_action( 'enqueue_block_editor_assets', 'customblockstyles_editor_assets' );
/* Register CSS for the block styles */
function custom_block_styles() {
wp_enqueue_style(
'custom-block-styles', plugins_url( 'custom-block-styles.css', __FILE__ ) );
}
add_action( 'enqueue_block_assets', 'custom_block_styles' );