forked from barryhughes/event-rocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlauncher.php
executable file
·54 lines (42 loc) · 1.79 KB
/
launcher.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
<?php
/**
* Plugin Name: Event Rocket
* Description: Adds shortcodes and other tools to help build sites with The Events Calendar/Events Calendar PRO.
* Version: 3.3
* Author: Barry Hughes
* Author URI: http://codingkills.me
* License: GPLv3 or later
*/
defined( 'ABSPATH' ) or exit();
add_action( 'plugins_loaded', 'eventrocket_launch' );
function eventrocket_launch() {
define( 'EVENTROCKET_INC', dirname( __FILE__ ) );
define( 'EVENTROCKET_URL', plugin_dir_url( __FILE__ ) );
// @todo we'll bump the min required TEC ver and switch to the new classnames across the board
if ( class_exists( 'Tribe__Events__Main' ) ) $version = Tribe__Events__Main::VERSION;
if ( ! isset( $version ) || version_compare( $version, '3.10', '<' ) ) {
eventrocket_abort_launch();
return;
}
load_plugin_textdomain( 'event-rocket', false, dirname( plugin_basename( __FILE__ ) ) . '/lang' );
require_once EVENTROCKET_INC . '/embedding/embedding.php';
require_once EVENTROCKET_INC . '/data-requests/data-requests.php';
require_once EVENTROCKET_INC . '/admin/admin.php';
require_once EVENTROCKET_INC . '/misc/load.php';
require_once EVENTROCKET_INC . '/rsvp/rsvp.php';
}
function eventrocket_abort_launch() {
global $pagenow;
require_once EVENTROCKET_INC . '/misc/clean-up.php';
if ( 'plugins.php' === $pagenow ) add_action( 'admin_notices', 'eventrocket_explain_failure' );
}
function eventrocket_explain_failure() {
$msg = __( 'Event Rocket requires a suitable version of The Events Calendar to be activated in order to provide '
. 'full functionality (data cleanup tools will still be available, though).', 'event-rocket' );
echo '<div class="error"> <p> ' . $msg . ' </p> </div>';
}
function eventrocket() {
static $register = null;
if ( null === $register ) $register = new stdClass;
return $register;
}