-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathxcore.php
More file actions
58 lines (51 loc) · 1.59 KB
/
xcore.php
File metadata and controls
58 lines (51 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
56
57
58
<?php
include_once(ABSPATH . 'wp-admin/includes/plugin.php');
/*
Plugin Name: Xcore Rest API extension
Plugin URI: https://xcore.nl/
description: This plugin adds additional functionality to the Woocommerce Rest API to support the features provided by our Xcore platform.
@Version: 1.15.0
@Author: Xcore
Author URI: https://xcore.nl/
Requires at least: 6.3.0
Tested up to: 6.8.1
License: GPL2
WC requires at least: 7.5.0
WC tested up to: 9.8.5
*/
if (!defined('ABSPATH')) {
exit;
}
if( ! function_exists('get_plugin_data') ){
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
if (!is_plugin_active( 'woocommerce/woocommerce.php')) {
add_action('admin_notices', static function () {
?>
<div class="error notice">
<p><b><?php
_e( 'xCore Rest API extension requires WooCommerce to be activated to work.',
'https://www.xcore.nl' ); ?></b></p>
</div>
<?php
});
}
add_action(
'woocommerce_loaded',
static function () {
if (!class_exists('Xcore')) {
include_once __DIR__ . '/includes/helpers/abstract-xcore-data-helper.php';
include_once __DIR__ . '/includes/helpers/class-xcore-helper.php';
include_once __DIR__ . '/includes/class-xcore.php';
Xcore::get_instance();
}
}
);
add_action(
'before_woocommerce_init',
function() {
if (class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class)) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
}
}
);