Last active
May 17, 2021 06:07
-
-
Save LaurenaRehbein/23a2c3fc5c5a7101790f961bcb275d02 to your computer and use it in GitHub Desktop.
Removes chosen Stripe Icons from the gateway
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
// 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'); |
Hey their, I tried this code it works great, it removes the JCB.svg but it will not remove the amex.svg icon, I have posted my code here, can anyone elaborate to why the stripe amex icon is still visible please and how to remove it, I have taken out the JCB one perfectly.
// Remove icons from Stripe gateway
function lar_remove_icons( $icons ) {
$icons = str_replace( '', '', $icons );
$icons = str_replace( '', '', $icons );
return $icons;
}
add_filter( 'woocommerce_gateway_icon', 'lar_remove_icons');
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is fantastic, thank you for this!!