This commit is contained in:
2025-07-18 16:12:34 -07:00
parent 2dd9e866f4
commit a045f2be65

View File

@@ -25,14 +25,9 @@ class DontShowProductsOnShopLandingPageAction extends RadAction
return; return;
} }
// Remove everything hooked to the product loop
remove_all_actions('woocommerce_before_shop_loop'); remove_all_actions('woocommerce_before_shop_loop');
remove_all_actions('woocommerce_shop_loop'); remove_all_actions('woocommerce_shop_loop');
remove_all_actions('woocommerce_after_shop_loop'); remove_all_actions('woocommerce_after_shop_loop');
// Also prevent product loop rendering itself
remove_all_actions('woocommerce_before_main_content');
remove_all_actions('woocommerce_after_main_content');
remove_all_actions('woocommerce_no_products_found'); remove_all_actions('woocommerce_no_products_found');
add_action('pre_get_posts', function ($query) { add_action('pre_get_posts', function ($query) {