I’m trying to check if WooCommerce 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 WooCommerce 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}
2
Answers
Try the following instead:
Alternatively, the function
is_plugin_active
method can be used to check if a plugin is active.Another method documented in WooCommerce is the below option.