Skip to content

Instantly share code, notes, and snippets.

@LaurenaRehbein
LaurenaRehbein / stripe-icon-removal.php
Last active May 17, 2021 06:07
Removes chosen Stripe Icons from the gateway
// Remove icons from Stripe gateway
function lar_remove_icons( $icons ) {
$icons = str_replace( '<img src="' . WC_HTTPS::force_https_url(WP_PLUGIN_URL . '/woocommerce-gateway-stripe/assets/images/jcb.svg' ) . '" class="stripe-jcb-icon stripe-icon" alt="JCB" />', '', $icons );
$icons = str_replace( '<img src="' . WC_HTTPS::force_https_url(WP_PLUGIN_URL . '/woocommerce-gateway-stripe/assets/images/discover.svg' ) . '" class="stripe-discover-icon stripe-icon" alt="Discover" />', '', $icons );
$icons = str_replace( '<img src="' . WC_HTTPS::force_https_url(WP_PLUGIN_URL . '/woocommerce-gateway-stripe/assets/images/diners.svg' ) . '" class="stripe-diners-icon stripe-icon" alt="Diners" />', '', $icons );
return $icons;
}
add_filter( 'woocommerce_gateway_icon', 'lar_remove_icons');