-
Notifications
You must be signed in to change notification settings - Fork 14
/
wp-event-calendar.php
110 lines (97 loc) · 2.88 KB
/
wp-event-calendar.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: WP Event Calendar
* Plugin URI: https://wordpress.org/plugins/wp-event-calendar/
* Author: John James Jacoby
* Author URI: https://jjj.blog/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: wp-event-calendar
* Version: 1.1.0
* Description: The best way to manage events in WordPress
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
/**
* Include the Event Calendar files
*
* @since 0.1.0
*/
function _wp_event_calendar() {
// Get the plugin path
$plugin_path = wp_event_calendar_get_plugin_path();
// Common files
require_once $plugin_path . 'includes/common/event.php';
require_once $plugin_path . 'includes/common/functions.php';
// Admin-only common files
require_once $plugin_path . 'includes/common/admin.php';
require_once $plugin_path . 'includes/common/list-table-base.php';
require_once $plugin_path . 'includes/common/list-table-month.php';
require_once $plugin_path . 'includes/common/list-table-week.php';
require_once $plugin_path . 'includes/common/list-table-day.php';
// Event files
require_once $plugin_path . 'includes/events/admin.php';
require_once $plugin_path . 'includes/events/editor.php';
require_once $plugin_path . 'includes/events/capabilities.php';
require_once $plugin_path . 'includes/events/cron.php';
require_once $plugin_path . 'includes/events/metaboxes.php';
require_once $plugin_path . 'includes/events/post-types.php';
require_once $plugin_path . 'includes/events/post-statuses.php';
require_once $plugin_path . 'includes/events/taxonomies.php';
require_once $plugin_path . 'includes/events/user-alerts.php';
require_once $plugin_path . 'includes/events/user-dashboard.php';
require_once $plugin_path . 'includes/events/hooks.php';
// For third-party plugins looking to load their files
do_action( 'wp_event_calendar_loaded' );
}
add_action( 'plugins_loaded', '_wp_event_calendar' );
/**
* Return the plugin's path
*
* @since 0.2.5
*
* @return string
*/
function wp_event_calendar_get_plugin_path() {
return plugin_dir_path( __FILE__ ) . 'wp-event-calendar/';
}
/**
* Return the plugin's URL
*
* @since 0.1.2
*
* @return string
*/
function wp_event_calendar_get_plugin_url() {
return plugin_dir_url( __FILE__ ) . 'wp-event-calendar/';
}
/**
* Return the asset version
*
* @since 0.1.2
*
* @return int
*/
function wp_event_calendar_get_asset_version() {
return 201612090001;
}
/**
* Deactivation hook
*
* @since 0.1.9
*/
function wp_event_calendar_activation_hook() {
_wp_event_calendar();
wp_event_calendar_cron_hook();
}
register_activation_hook( __FILE__, 'wp_event_calendar_activation_hook' );
/**
* Deactivation hook
*
* @since 0.1.9
*/
function wp_event_calendar_deactivation_hook() {
_wp_event_calendar();
wp_event_calendar_cron_unhook();
}
register_deactivation_hook( __FILE__, 'wp_event_calendar_deactivation_hook' );