forked from gocodebox/lifterlms-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lifterlms-rest.php
71 lines (60 loc) · 1.62 KB
/
lifterlms-rest.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
<?php
/**
* LifterLMS REST API Plugin
*
* @package LifterLMS_REST_API/Main
*
* @since 1.0.0-beta.1
* @version 1.0.0-beta.26
*
* Plugin Name: LifterLMS REST API
* Plugin URI: https://lifterlms.com/
* Description: REST API feature plugin for the LifterLMS Core.
* Version: 1.0.0-beta.29
* Author: LifterLMS
* Author URI: https://lifterlms.com/
* Text Domain: lifterlms
* Domain Path: /i18n
* License: GPLv3
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Requires LifterLMS: 7.0.2
*/
defined( 'ABSPATH' ) || exit;
// Don't load the REST API.
if ( defined( 'LLMS_REST_DISABLE' ) && LLMS_REST_DISABLE ) {
return;
}
// @todo handle this better.
if ( version_compare( phpversion(), '7.1', '<' ) ) {
return;
}
// Define Constants.
if ( ! defined( 'LLMS_REST_API_PLUGIN_FILE' ) ) {
define( 'LLMS_REST_API_PLUGIN_FILE', __FILE__ );
}
if ( ! defined( 'LLMS_REST_API_PLUGIN_DIR' ) ) {
define( 'LLMS_REST_API_PLUGIN_DIR', __DIR__ . '/' );
}
if ( ! defined( 'LLMS_REST_API_PLUGIN_URL' ) ) {
define( 'LLMS_REST_API_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
}
if ( ! defined( 'LLMS_REST_WEBHOOK_DELIVERY_LOGGING' ) ) {
define( 'LLMS_REST_WEBHOOK_DELIVERY_LOGGING', true );
}
// Load Plugin.
if ( ! class_exists( 'LifterLMS_REST_API' ) ) {
require_once LLMS_REST_API_PLUGIN_DIR . 'class-lifterlms-rest-api.php';
// phpcs:disable WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
/**
* Main Plugin Instance
*
* @since 1.0.0-beta.1
*
* @return LifterLMS_REST_API
*/
function LLMS_REST_API() {
return LifterLMS_REST_API::instance();
}
}
return LLMS_REST_API();
// phpcs:enable