Skip to content

Instantly share code, notes, and snippets.

@jameskoster
Created March 22, 2013 20:39
Show Gist options
  • Save jameskoster/5224553 to your computer and use it in GitHub Desktop.
Save jameskoster/5224553 to your computer and use it in GitHub Desktop.
Query whether WooCommerce is activated
if ( ! function_exists( 'is_woocommerce_activated' ) ) {
function is_woocommerce_activated() {
if ( class_exists( 'woocommerce' ) ) { return true; } else { return false; }
}
}
@WordpressDev
Copy link

if ( ! function_exists( 'is_woocommerce_activated' ) ) {
    function is_woocommerce_activated() {
        return class_exists( 'woocommerce' );
    }
}

This is enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment