-
Notifications
You must be signed in to change notification settings - Fork 0
/
oauth_gcal.php
37 lines (30 loc) · 2.49 KB
/
oauth_gcal.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
<?php
/*
* @wordpress-plugin
* Plugin Name: _ANDYP - ACF - OAUTH for Google Calendar
* Plugin URI: http:https://londonparkour.com
* Description: <strong>🔌PLUGIN</strong> | ACF oAuth for Google Calendar
* Version: 1.0.0
* Author: Andy Pearson
* Author URI: https://londonparkour.com
* Domain Path: /languages
*/
define( 'ANDYP_GCALOAUTH_PATH', __DIR__ );
define( 'ANDYP_GCALOAUTH_URL', plugins_url( '/', __FILE__ ) );
define( 'GCAL_GOOGLE_APPLICATION_CREDENTIALS', __DIR__.'/client_secret.json');
define( 'GCAL_GOOGLE_APPLICATION_SCOPE', "https://www.googleapis.com/auth/calendar");
define( 'GCAL_GOOGLE_TRANSIENT_NAME', "GCAL_OAUTH_REFRESH_TOKEN");
// ┌─────────────────────────────────────────────────────────────────────────┐
// │ Register with ANDYP Plugins │
// └─────────────────────────────────────────────────────────────────────────┘
require __DIR__.'/src/acf/andyp_plugin_register.php';
// ┌─────────────────────────────────────────────────────────────────────────┐
// │ Use composer autoloader │
// └─────────────────────────────────────────────────────────────────────────┘
require __DIR__.'/vendor/autoload.php';
// ┌─────────────────────────────────────────────────────────────────────────┐
// │ Initialise │
// └─────────────────────────────────────────────────────────────────────────┘
if (file_exists(ANDYP_GCALOAUTH_PATH. '/client_secret.json')) {
new AndyP\oauth\gcal\gcal;
}