-
Notifications
You must be signed in to change notification settings - Fork 5
/
reacts-gutenberg-block.php
69 lines (59 loc) · 1.54 KB
/
reacts-gutenberg-block.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
<?php
/**
* Plugin's bootstrap file to launch the plugin.
*
* @package Reacts_Block
* @author Julien Melissas (@julienmelissas)
* @license GPL2+
*
* @wordpress-plugin
* Plugin Name: Post Reacts Gutenberg Block
* Plugin URI: https://github.com/zgordon/wceu-2018
* Description: A Gutenberg Block to allow users to "react" to posts on the frontend. Built for the WordCamp Europe 2018 workshop with Zac Gordon & Julien Melissas.
* Version: 1.0.0
* Author: Julien Melissas & Zac Gordon
* Author URI: https://2018.europe.wordcamp.org/session/gutenberg-block-development-with-react/
* Text Domain: reactsblock
* Domain Path: /languages
* License: GPL2+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
namespace Reacts_Block;
// Exit if accessed directly.
defined('ABSPATH') || exit;
/**
* Gets this plugin's absolute directory path.
*
* @since 1.0.0
* @ignore
* @access private
*
* @return string
*/
function _get_plugin_directory() {
return __DIR__;
}
/**
* Gets this plugin's URL.
*
* @since 1.0.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/enqueue-scripts.php';
// Register meta boxes
include __DIR__ . '/lib/meta-boxes.php';
// Code for the dynamic portion of the block
include __DIR__ . '/src/blocks/reacts/index.php';
// Code for the API Endpoint
include __DIR__ . '/lib/api.php';