Created
March 30, 2020 19:39
-
-
Save bologer/5f16b016e81c7c01c5bf5950be5e80ea to your computer and use it in GitHub Desktop.
Remove AnyComment's comments template from WooCommerce single page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Overrides anycomment template on WooCommerce single product page. | |
* | |
* @param $theme_template | |
* | |
* @return string | |
*/ | |
function anycomment_woocommerce_override( $theme_template ) { | |
if ( class_exists( 'WooCommerce' ) && is_product() ) { | |
return STYLESHEETPATH . '/comments.php'; | |
} | |
return $theme_template; | |
} | |
add_filter( 'comments_template', 'anycomment_woocommerce_override', 1100, 1 ); | |
add_filter( 'woocommerce_product_tabs', 'woocommerce_default_product_tabs', 1000 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment