-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.php
52 lines (45 loc) · 1.35 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
<?php
/**
* Plugin Name: Guty Blocks
* Description: A "simple" boilerplate for creating gutenblocks
* Version: 1.0.0
* Author: Jim Schofield
* Text Domain: guty-blocks
* Domain Path: /languages
*
* @package guty-blocks
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* The full path and filename of this bootstrap file with symlinks resolved.
*
* @var string GUTYBLOCKS_BOOTSTRAP_FILE
*/
define( 'GUTYBLOCKS_BOOTSTRAP_FILE', __FILE__ );
/**
* The full path to the parent directory of this bootstrap file with symlinks resolved, with trailing slash.
*
* @var string GUTYBLOCKS_DIR
*/
define( 'GUTYBLOCKS_DIR', dirname( GUTYBLOCKS_BOOTSTRAP_FILE ) . '/' );
/**
* The relative path to this plugin directory, from WP_PLUGIN_DIR, with trailing slash.
*
* @var string GUTYBLOCKS_REL_DIR
*/
define( 'GUTYBLOCKS_REL_DIR', basename( GUTYBLOCKS_DIR ) . '/' );
/**
* The URL of the plugin directory, with trailing slash.
*
* Example: https://example.local/wp-content/plugins/hcmc-custom-objects/
*
* @const string GUTYBLOCKS_URL
*/
define( 'GUTYBLOCKS_URL', plugins_url( '/', GUTYBLOCKS_BOOTSTRAP_FILE ) );
// Automatically load all "blocks" -- New blocks are required to have an index.php file in order to be loaded.
foreach ( glob( dirname( __FILE__ ) . '/blocks/*/index.php' ) as $block_logic ) {
require $block_logic;
}