diff options
Diffstat (limited to 'plugins/jetpack/3rd-party/woocommerce.php')
-rw-r--r-- | plugins/jetpack/3rd-party/woocommerce.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/jetpack/3rd-party/woocommerce.php b/plugins/jetpack/3rd-party/woocommerce.php index 3ecdb2ab..5245e906 100644 --- a/plugins/jetpack/3rd-party/woocommerce.php +++ b/plugins/jetpack/3rd-party/woocommerce.php @@ -35,6 +35,26 @@ function jetpack_woocommerce_social_share_icons() { } /** + * Remove sharing display from account, cart, and checkout pages in WooCommerce. + */ +function jetpack_woocommerce_remove_share() { + /** + * Double check WooCommerce exists - unlikely to fail due to the hook being used but better safe than sorry. + */ + if ( ! class_exists( 'WooCommerce' ) ) { + return; + } + + if ( is_cart() || is_checkout() || is_account_page() ) { + remove_filter( 'the_content', 'sharing_display', 19 ); + if ( class_exists( 'Jetpack_Likes' ) ) { + remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 ); + } + } +} +add_action( 'loop_start', 'jetpack_woocommerce_remove_share' ); + +/** * Add a callback for WooCommerce product rendering in infinite scroll. * * @param array $callbacks |