forked from zgordon/advanced-gutenberg-course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.php
77 lines (63 loc) · 1.69 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* Main plugin file
*
* @package Adv_Gutenberg_Courses\Example_Blocks
* @author Zac Gordon (@zgordon)
* @license GPL2+
*
* @wordpress-plugin
* Plugin Name: Gutenberg - Advanced Examples
* Plugin URI: https://javascriptforwp.com/
* Description: A plugin containing advanced examples for developers. From <a href="https://javascriptforwp.com/product/advanced-gutenberg-development/">Zac Gordon's Advanced Gutenberg Development Course</a>.
* Version: 1.0.0
* Author: Zac Gordon
* Author URI: https://twitter.com/zgordon
* Text Domain: jsforwpadvblocks
* Domain Path: /languages
* License: GPL2+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
namespace Adv_Gutenberg_Courses\Example_Blocks;
// Exit if accessed directly.
defined('ABSPATH') || exit;
/**
* Gets this plugin's absolute directory path.
*
* @since 2.1.0
* @ignore
* @access private
*
* @return string
*/
function _get_plugin_directory() {
return __DIR__;
}
/**
* Gets this plugin's URL.
*
* @since 2.1.0
* @ignore
* @access private
*
* @return string
*/
function _get_plugin_url() {
static $plugin_url;
if ( empty( $plugin_url ) ) {
$plugin_url = plugins_url( null, __FILE__ );
}
return $plugin_url;
}
// Enqueue JS and CSS
include __DIR__ . '/lib/register-scripts.php';
// Register block categories
include __DIR__ . '/lib/block-categories.php';
// Setup Global Block Setting Options Setting
include __DIR__ . '/lib/wp-options.php';
// Register REST API Endpoint
include __DIR__ . '/lib/rest-api-endpoint.php';
// Register blocks server side
include __DIR__ . '/lib/register-blocks.php';
// Register any PHP block filters
include __DIR__ . '/lib/block-filters.php';