-
Notifications
You must be signed in to change notification settings - Fork 1
/
cardanopress-governance.php
61 lines (50 loc) · 1.54 KB
/
cardanopress-governance.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
<?php
/**
* Plugin Name: CardanoPress - Governance
* Plugin URI: https://github.com/CardanoPress/plugin-governance
* Author: CardanoPress
* Author URI: https://cardanopress.io
* Description: A CardanoPress extension for governance
* Version: 1.7.0
* License: GPL-2.0-only
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*
* Text Domain: cardanopress-governance
*
* Requires at least: 5.9
* Requires PHP: 7.4
*
* Requires Plugins: cardanopress
*
* @package ThemePlate
* @since 0.1.0
*/
// Accessed directly
if (! defined('ABSPATH')) {
exit;
}
use PBWebDev\CardanoPress\Governance\Application;
use PBWebDev\CardanoPress\Governance\Installer;
/* ==================================================
Global constants
================================================== */
if (! defined('CP_GOVERNANCE_FILE')) {
define('CP_GOVERNANCE_FILE', __FILE__);
}
// Load the main plugin class
require_once plugin_dir_path(CP_GOVERNANCE_FILE) . 'dependencies/vendor/autoload_packages.php';
require_once plugin_dir_path(CP_GOVERNANCE_FILE) . 'dependencies/vendor/woocommerce/action-scheduler/action-scheduler.php';
// Instantiate
function cpGovernance(): Application
{
static $application;
if (null === $application) {
if (! function_exists('get_plugins')) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$application = new Application(CP_GOVERNANCE_FILE);
}
return $application;
}
cpGovernance()->setupHooks();
(new Installer(cpGovernance()))->setupHooks();