-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
64 lines (57 loc) · 1.51 KB
/
bootstrap.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
<?php
/**
* Custom Meta Box Generator Plugin
*
* @package ChristophHerr\CustomMetaBoxGenerator
* @author christophherr
* @license GPL-2.0-or-later
*
* @wordpress-plugin
* Plugin Name: Custom Meta Box Generator
* Plugin URI: https://github.com/christophherr/custom-meta-box-generator
* Description: Plugin to generate reusable Custom Meta Boxes.
* Version: 1.0.0
* Author: christophherr
* Author URI: https://www.christophherr.com
* Text Domain: custom-meta-box-generator-generator
* License: GPL-2.0-or-later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
namespace ChristophHerr\CustomMetaBoxGenerator;
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Cheatin’ uh?' );
}
/**
* Setup the plugin's constants.
*
* @since 1.0.0
*
* @return void
*/
function init_constants() {
$plugin_url = plugin_dir_url( __FILE__ );
if ( is_ssl() ) {
$plugin_url = str_replace( 'http://', 'https://', $plugin_url );
}
define( 'CUSTOM_META_BOX_URL', $plugin_url );
define( 'CUSTOM_META_BOX_DIR', plugin_dir_path( __FILE__ ) );
}
/**
* Launch the plugin
*
* @since 1.0.0
*
* @return void
*/
function launch() {
init_constants();
require __DIR__ . '/src/config-store/module.php';
require __DIR__ . '/src/metadata/module.php';
require __DIR__ . '/src/output.php';
// Load configuration files into the module.
\ChristophHerr\CustomMetaBoxGenerator\Metadata\autoload_configurations( array(
__DIR__ . '/config/subtitle.php',
__DIR__ . '/config/portfolio.php',
) );
}
launch();