This repository was archived by the owner on Jan 8, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplugin.php
More file actions
54 lines (47 loc) · 1.28 KB
/
plugin.php
File metadata and controls
54 lines (47 loc) · 1.28 KB
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
48
49
50
51
52
53
54
<?php
/**
* Plugin Name: Bricks
* Plugin URI: https://mojavehq.com/plugins/bricks
* Description: Bricks is a WordPress starter plugin to quickly and cleanly build Gutenberg blocks with Tailwind CSS.
* Author: Mojave HQ
* Author URI: https://mojavehq.com/
* Version: 1.0.0
* License: MIT
* License URI: https://github.com/mojave-hq/bricks/blob/master/LICENSE.md.
*/
namespace MojaveHQ\Bricks;
// Exit if accessed directly.
if (!defined('ABSPATH')) {
exit;
}
function register()
{
\wp_register_style(
'bricks-style',
plugin_dir_url(__FILE__).'public/css/plugin.css',
is_admin() ? ['wp-editor'] : null,
null
);
\wp_register_style(
'bricks-editor-style',
plugin_dir_url(__FILE__).'public/css/plugin.css',
['wp-edit-blocks'],
null
);
\wp_register_script(
'bricks-script',
plugin_dir_url(__FILE__).'public/js/plugin.js',
['wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor'],
null,
true
);
\register_block_type(
'bricks/block',
[
'style' => 'bricks-style',
'editor_script' => 'bricks-script',
'editor_style' => 'bricks-editor-style',
]
);
}
\add_action('init', __NAMESPACE__.'\\register');