| 1 |
<?php |
| 2 |
/** |
| 3 |
* WC Dependency Checker |
| 4 |
* |
| 5 |
* Checks if WooCommerce is enabled |
| 6 |
*/ |
| 7 |
class WC_GST_Dependencies { |
| 8 |
|
| 9 |
private static $active_plugins; |
| 10 |
|
| 11 |
public static function init() { |
| 12 |
|
| 13 |
self::$active_plugins = (array) get_option( 'active_plugins', array() ); |
| 14 |
|
| 15 |
if ( is_multisite() ) |
| 16 |
self::$active_plugins = array_merge( self::$active_plugins, get_site_option( 'active_sitewide_plugins', array() ) ); |
| 17 |
} |
| 18 |
|
| 19 |
public static function fn_woocommerce_active_check() { |
| 20 |
|
| 21 |
if ( ! self::$active_plugins ) self::init(); |
| 22 |
return in_array( 'woocommerce/woocommerce.php', self::$active_plugins ) || array_key_exists( 'woocommerce/woocommerce.php', self::$active_plugins ); |
| 23 |
} |
| 24 |
|
| 25 |
} |
| 26 |
?> |