From e7250d81ed4ba903f4653e0d359f7964eba96610 Mon Sep 17 00:00:00 2001 From: "d[esign]Void" Date: Thu, 1 Oct 2020 17:37:57 +0100 Subject: [PATCH] Make woocomerce hooks pluggable By making the WooCommerce hooks pluggable functions it's possible to control the layout in a child theme. --- inc/addons.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/inc/addons.php b/inc/addons.php index 49c7851..47089ea 100644 --- a/inc/addons.php +++ b/inc/addons.php @@ -89,9 +89,12 @@ function chronus_infinite_scroll_render() { /** * Set wrapper start for wooCommerce */ -function chronus_wrapper_start() { - echo '
'; - echo '
'; +if (!function_exists('chronus_wrapper_start')) { + function chronus_wrapper_start() + { + echo '
'; + echo '
'; + } } remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); add_action( 'woocommerce_before_main_content', 'chronus_wrapper_start', 10 ); @@ -100,9 +103,12 @@ function chronus_wrapper_start() { /** * Set wrapper end for wooCommerce */ -function chronus_wrapper_end() { - echo '
'; - echo '
'; +if (!function_exists('chronus_wrapper_end')) { + function chronus_wrapper_end() + { + echo '
'; + echo '
'; + } } remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); add_action( 'woocommerce_after_main_content', 'chronus_wrapper_end', 10 );