-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
49 lines (34 loc) · 1.35 KB
/
index.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
<?php
/*
Plugin Name: Cerberus Content Next
Plugin URI: http://24hr.se
Description: Saves content to a Draft Content Service and gives the possibility to push the content to live
Version: 1.1.30
Author: Dr Tapia <[email protected]>
*/
// don't load directly
if ( !defined( 'ABSPATH' ) ) {
error_log('ABSPATH not defined - terminating...');
die( '-1' );
} else {
$dir = dirname( __FILE__ );
$plugin_info = get_file_data(__FILE__, array( 'Version' => 'Version') );
define('DraftLiveSyncVERSION', $plugin_info['Version']);
include_once 'lib/php-jwt/src/JWT.php';
require_once 'lib/graphql.php';
require_once 'main/draft-live-sync-wp-cron-fix.php';
require_once 'main/draft-live-sync-settings.php';
require_once 'main/draft-live-sync/draft-live-sync-class.php';
require_once 'main/wp-menus/init.php';
function draft_live_sync_init_new() {
// Init or use instance of the manager.
$dir = dirname( __FILE__ );
$api_token = getenv('API_TOKEN');
$content_host = getenv('CONTENT_HOST') ? getenv('CONTENT_HOST') : 'http://content';
if(class_exists( 'DraftLiveSync' )){
global $draft_live_sync;
$draft_live_sync = new DraftLiveSync($dir, DraftLiveSyncVERSION, $content_host, $api_token);
}
}
add_action( 'init', 'draft_live_sync_init_new');
}