-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.php
58 lines (48 loc) · 1.93 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* @wordpress-plugin
* Plugin Name: Multi Breakpoint Columns
* Plugin URI: https://fullstackdigital.io
* Description: Adds additional breakpoints to the core columns block
* Version: 0.1.0
* Author: Anton Plauche
* Author URI: https://fullstackdigital.io
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: mbpc
* Domain Path: /languages
*/
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
/**
* Current plugin version.
*/
define('MBPC_VERSION', '0.1.0');
class MultiBreakpointColumns
{
public function __construct()
{
// Base path is used to include PHP server-side
$this->basePath = plugin_dir_path(__FILE__);
// Base url is used for the client side asset urls
$this->baseUrl = plugins_url('/', __FILE__);
// Get our asset.php files that include version and dependency info
$this->jsAssetInfo = include($this->basePath . 'build/js/editor.asset.php');
$this->cssAssetInfo = include($this->basePath . 'build/css/style.asset.php');
// Hooks for the editor and front end - uses array callable syntax: [class instance, method name to call]
add_action('enqueue_block_editor_assets', [$this, 'addEditorAssets']);
add_action('wp_enqueue_scripts', [$this, 'addFrontEndAssets']);
}
public function addEditorAssets()
{
wp_enqueue_style('mbpc-editor-css', $this->baseUrl . 'build/css/style-style.css', $this->cssAssetInfo['dependencies'], $this->cssAssetInfo['version']);
wp_enqueue_script('mbpc-editor-js', $this->baseUrl . 'build/js/editor.js', $this->jsAssetInfo['dependencies'], $this->jsAssetInfo['version']);
}
public function addFrontEndAssets()
{
wp_enqueue_style('mbpc-frontend-css', $this->baseUrl . 'build/css/style-style.css', $this->cssAssetInfo['dependencies'], $this->cssAssetInfo['version']);
}
}
new MultiBreakpointColumns();