// Czy wtyczka jest aktywna - Przykład WooCommerce | |
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { | |
echo 'WooCommerce aktywny.'; | |
} else { | |
echo 'WooCommerce nie aktywny.'; | |
} | |
// Czy klasa istnieje - If Class Exist | |
if ( class_exists( 'WooCommerce' ) ) { | |
// Kod wymagający WooCommerce | |
} else { | |
// Inny kod, gdy klasa nie istnieje - najczęściej puste | |
} | |
// Czy funkcja istnieje - If function exist | |
if (function_exists('register_nav_menus')) { | |
register_nav_menus (array('primary' => 'MENU GORNE')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment