-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.php
40 lines (34 loc) · 990 Bytes
/
plugin.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
<?php
/**
* Plugin Name: WooCommerce Export.
* Description: Export various data from WooCommerce
* Author: Fredrik Forsmo
* Author URI: https://frozzare.com
* Version: 1.0.0
* Plugin URI: https://github.com/frozzare/wc-export
* Textdomain: wc-export
* Domain Path: /languages/
*/
// Load `is_plugin_active` function.
if ( ! function_exists( 'is_plugin_active' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
// Load settings error functions.
if ( ! function_exists( 'add_settings_error' ) ) {
require_once ABSPATH . 'wp-admin/includes/template.php';
}
// Load Composer autoloader.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require __DIR__ . '/vendor/autoload.php';
}
/**
* Load WooCommerce Export plugin.
*
* @return \Frozzare\WooCommerce\Export\Admin|null
*/
add_action( 'plugins_loaded', function () {
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
return;
}
return new \Frozzare\WooCommerce\Export\Admin;
} );