Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save carasmo/114b9c95e86b76a89ec85d5921fc9d86 to your computer and use it in GitHub Desktop.
Save carasmo/114b9c95e86b76a89ec85d5921fc9d86 to your computer and use it in GitHub Desktop.
<?php
// do not repeat in your code -- that is don't paste this line in and read comments too.
add_action( 'genesis_loop', 'your_prefix_remove_genesis_simple_share_woo_pages', 0 );
/**
* Remove Genesis Simple Share from WooCommerce (not product pages)
*/
function your_prefix_remove_genesis_simple_share_woo_pages() {
if ( ! class_exists( 'Gensis_Simple_Share_Front_End' ) && ! class_exists( 'WooCommerce' ) ) return;
if(
is_cart()
|| is_checkout()
|| is_account_page()
|| is_wc_endpoint_url( 'order-pay' )
|| is_wc_endpoint_url( 'order-received' )
|| is_wc_endpoint_url( 'view-order' )
|| is_wc_endpoint_url( 'edit-account' )
|| is_wc_endpoint_url( 'edit-address' )
|| is_wc_endpoint_url( 'lost-password' )
|| is_wc_endpoint_url( 'customer-logout' )
|| is_wc_endpoint_url( 'add-payment-method' )
) :
global $Genesis_Simple_Share;
remove_action( 'genesis_loop', array( $Genesis_Simple_Share, 'start_icon_actions' ), 5 );
endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment