-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlazy-lists.php
49 lines (42 loc) · 1.04 KB
/
lazy-lists.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
48
49
<?php
/**
* Plugin Name: Lazy Lists
* Description: Advanced list tools for WordPress.
* Version: 1.0.2
* Author: sorta brilliant
* Author URI: https://sortabrilliant.com/
* License: GPL-2.0-or-later
* Text Domain: lazy-lists
*/
namespace SortaBrilliant\LazyLists;
const VERSION = '1.0.2';
add_action( 'enqueue_block_editor_assets', function () {
$asset_filepath = __DIR__ . '/build/index.asset.php';
$asset_file = file_exists( $asset_filepath ) ? include $asset_filepath : [
'dependencies' => [],
'version' => VERSION,
];
wp_enqueue_script(
'lazy-lists-editor-script',
plugins_url( 'build/index.js', __FILE__ ),
$asset_file['dependencies'],
$asset_file['version']
);
wp_enqueue_style(
'lazy-lists-editor-style',
plugins_url( 'build/css/editor.css', __FILE__ ),
[],
VERSION
);
} );
add_action( 'enqueue_block_assets', function () {
if ( is_admin() ) {
return;
}
wp_enqueue_style(
'lazy-lists-style',
plugins_url( 'build/css/style.css', __FILE__ ),
[],
VERSION
);
} );