-
Notifications
You must be signed in to change notification settings - Fork 50
/
wc-smooth-generator.php
59 lines (51 loc) · 1.33 KB
/
wc-smooth-generator.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
<?php
/**
* Plugin Name: WooCommerce Smooth Generator
* Plugin URI: https://woocommerce.com
* Description: A smooth product, order, customer, and coupon generator for WooCommerce.
* Version: 1.2.1
* Author: Automattic
* Author URI: https://woocommerce.com
*
* Tested up to: 6.5
* Requires PHP: 7.4
* WC requires at least: 5.0.0
* WC tested up to: 9.1.0
* Woo: 000000:0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0
*
* @package WooCommerce
*/
defined( 'ABSPATH' ) || exit;
// autoloader.
if ( ! class_exists( \WC\SmoothGenerator\Plugin::class ) ) {
require __DIR__ . '/vendor/autoload.php';
}
/**
* Fetch instance of plugin.
*
* @return \WC\SmoothGenerator\Plugin
*/
function wc_smooth_generator() {
static $instance;
if ( is_null( $instance ) ) {
$instance = new \WC\SmoothGenerator\Plugin( __FILE__ );
}
return $instance;
}
/**
* Init plugin when WordPress loads.
*/
function load_wc_smooth_generator() {
wc_smooth_generator();
}
if ( version_compare( PHP_VERSION, '7.4', '>=' ) ) {
add_action( 'plugins_loaded', 'load_wc_smooth_generator', 20 );
}
/**
* Declare HPOS compatibility.
*/
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 );
}
} );