fix: guard is_woocommerce() with function_exists() — fatal when WC not active
Call to undefined function is_woocommerce() in perf-asset-policy.php:69 caused a 500 on all page loads. WooCommerce is not active on this site. Added function_exists() guard so the WC asset dequeue block is skipped when WooCommerce is not installed.
This commit is contained in:
@@ -66,7 +66,7 @@ function peptide_starter_perf_dequeue_plugin_assets() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WooCommerce assets: dequeue on non-shop pages.
|
// WooCommerce assets: dequeue on non-shop pages.
|
||||||
if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() && ! is_account_page() ) {
|
if ( function_exists( 'is_woocommerce' ) && ! is_woocommerce() && ! is_cart() && ! is_checkout() && ! is_account_page() ) {
|
||||||
// Get configured WC handles from filter; default list.
|
// Get configured WC handles from filter; default list.
|
||||||
$wc_styles = apply_filters(
|
$wc_styles = apply_filters(
|
||||||
'peptide_starter_perf_woocommerce_styles',
|
'peptide_starter_perf_woocommerce_styles',
|
||||||
|
|||||||
Reference in New Issue
Block a user