-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmc-wp-starter-plugin.php
More file actions
executable file
·72 lines (61 loc) · 1.86 KB
/
mc-wp-starter-plugin.php
File metadata and controls
executable file
·72 lines (61 loc) · 1.86 KB
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
<?php
/*
Plugin Name: MC WP Starter Plugin
Plugin URI: http://modernclimaate.com
Description: A starter plugin for Modern Climate WordPress projects.
Version: 1.0.0
Author: Modern Climate
Author URI: http://modernclimate.com
Copyright: MIT
Text Domain: mc-starter-plugin
*/
use MCP\App\Core\Init;
use MCP\App\Core\Dependencies;
use MCP\App\Setup;
use MCP\App\Scripts;
use MCP\App\Media;
use MCP\App\Shortcodes;
use MCP\App\Fields\ACF;
use MCP\App\Fields\Options;
use MCP\App\Fields\FieldGroups\SiteOptionsFieldGroup;
/**
* Define Plugin Version
* Define Plugin directories
*/
define('MCP_PLUGIN_VERSION', '1.0.0');
define('MCP_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('MCP_PLUGIN_PATH_URL', trailingslashit(plugins_url('mc-wp-starter-plugin')));
define('MCP_BASE_REST_URL', home_url() . '/wp-json/mcp/v1');
require __DIR__ . '/constants.php';
// Require Autoloader
require_once MCP_PLUGIN_DIR . 'vendor/autoload.php';
// Register and check for our plugin dependencies.
$dependencies = (new Dependencies())->checkDependencies(
__('MC WP Starter Plugin', 'mc-starter-plugin'),
[],
['Advanced Custom Fields Pro' => 'advanced-custom-fields-pro/acf.php']
);
// Only continue if dependencies are present.
if (!$dependencies) {
return false;
}
/**
* Plugin Setup
*/
add_action('plugins_loaded', function () {
(new Init())
->add(new Setup())
->add(new Scripts())
->add(new Media())
->add(new Shortcodes())
->add(new ACF())
->add(new Options())
->add(new SiteOptionsFieldGroup())
->initialize();
// Translation setup
load_plugin_textdomain('mc-starter-plugin', false, MCP_PLUGIN_DIR . '/languages');
});
// Activation hooks
register_activation_hook(__FILE__, ['MCP\App\Activation', 'activation']);
// Deactivation hooks
register_deactivation_hook(__FILE__, ['MCP\App\Activation', 'deactivation']);