I'm trying to check if woo commerce plugin is active then add some options to the option panel. but this code doesn't work right.
can anyone tell me what is wrong? thanks.
if( class_exists( 'WooCommerce' )) {//add options}
I'm trying to check if woo commerce plugin is active then add some options to the option panel. but this code doesn't work right.
can anyone tell me what is wrong? thanks.
if( class_exists( 'WooCommerce' )) {//add options}
Try the following instead:
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
// Yes, WooCommerce is enabled
} else {
// WooCommerce is NOT enabled!
}