-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcalendar-event-sync.php
More file actions
55 lines (46 loc) · 1.59 KB
/
calendar-event-sync.php
File metadata and controls
55 lines (46 loc) · 1.59 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
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the
* plugin admin area. This file also includes all of the dependencies used by
* the plugin, registers the activation and deactivation functions, and defines
* a function that starts the plugin.
*
* @link https://github.com/outlandishideas/calendar-event-sync
* @since 0.1.0
* @package tutsplus_namespace_demo
*
* @wordpress-plugin
* Plugin Name: Calendar Event Sync
* Plugin URI: https://github.com/outlandishideas/calendar-event-sync
* Description: WordPress plugin to sync events from your calendar to WordPress
* Version: 0.1.0
* Author: Outlandish Cooperative
* Author URI: https://outlandish.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
*/
use Outlandish\CalendarEventSync\CalendarEventSyncPlugin;
if(getenv('APP_ENV') !== 'testing') {
if (class_exists("WP_CLI")) {
$requiredConstants = [
'GOOGLE_CALENDAR_CLIENT_ID',
'GOOGLE_CALENDAR_PROJECT_ID',
'GOOGLE_CALENDAR_CLIENT_SECRET',
'GOOGLE_CALENDAR_ID',
];
foreach ($requiredConstants as $name) {
if (!defined($name)) {
return;
}
}
$plugin = new CalendarEventSyncPlugin(
GOOGLE_CALENDAR_CLIENT_ID,
GOOGLE_CALENDAR_CLIENT_SECRET,
GOOGLE_CALENDAR_PROJECT_ID,
GOOGLE_CALENDAR_ID
);
$plugin->init();
}
}