-
Notifications
You must be signed in to change notification settings - Fork 24
/
ultimate-blocks.php
110 lines (93 loc) · 2.89 KB
/
ultimate-blocks.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* Plugin Name: Ultimate Blocks
* Plugin URI: https://ultimateblocks.com/
* Description: Custom Blocks for Bloggers and Marketers. Create Better Content With Gutenberg.
* Author: Ultimate Blocks
* Author URI: https://ultimateblocks.com/
* Version: 3.2.2
* License: GPL3+
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
* Text Domain: ultimate-blocks
* Domain Path: /languages
*
* @package UB
*/
// Exit if accessed directly.
use Ultimate_Blocks\includes\Env_Manager;
use Ultimate_Blocks\includes\pro_manager\Pro_Manager;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
require_once 'includes/class-ultimate-blocks-constants.php';
/**
* Currently plugin version.
* Start at version 1.0.0 and use SemVer - https://semver.org
*/
define( 'ULTIMATE_BLOCKS_VERSION', Ultimate_Blocks_Constants::plugin_version() );
/**
* Plugin Name
*/
define( 'ULTIMATE_BLOCKS_NAME', Ultimate_Blocks_Constants::plugin_name() );
/**
* Plugin Path
*/
define( 'ULTIMATE_BLOCKS_PATH', Ultimate_Blocks_Constants::plugin_path() );
/**
* Plugin URL
*/
define( 'ULTIMATE_BLOCKS_URL', Ultimate_Blocks_Constants::plugin_url() );
/**
* Plugin TextDomain
*/
define( 'ULTIMATE_BLOCKS_TEXT_DOMAIN', Ultimate_Blocks_Constants::text_domain() );
/**
* Plugin __FILE__
*/
define( 'ULTIMATE_BLOCKS_PLUGIN_FILE', __FILE__ );
require_once trailingslashit( ULTIMATE_BLOCKS_PATH ) . 'vendor/autoload.php';
/**
* Block Initializer.
*/
require_once plugin_dir_path( __FILE__ ) . 'src/init.php';
/**
* The code that runs during plugin activation.
* This action is documented in includes/class-ultimate-blocks-activator.php
*/
function activate_ultimate_blocks() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-ultimate-blocks-activator.php';
Ultimate_Blocks_Activator::activate();
}
/**
* The code that runs during plugin deactivation.
* This action is documented in includes/class-ultimate-blocks-deactivator.php
*/
function deactivate_ultimate_blocks() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-ultimate-blocks-deactivator.php';
Ultimate_Blocks_Deactivator::deactivate();
}
register_activation_hook( __FILE__, 'activate_ultimate_blocks' );
register_deactivation_hook( __FILE__, 'deactivate_ultimate_blocks' );
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-ultimate-blocks.php';
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.2
*/
function run_ultimate_blocks() {
$plugin = new Ultimate_Blocks();
$plugin->run();
}
// initialize env manager.
Env_Manager::init();
// initialize license provider.
Pro_Manager::init_freemius();
add_action( 'plugins_loaded', 'run_ultimate_blocks', 10, 1 );