Automattic\WooCommerce\Blocks\BlockTypes
PaymentMethodIcons::get_card_type_icon_url
Get the card type icon URL.
Method of the class: PaymentMethodIcons{}
No Hooks.
Returns
String. Card type icon URL.
Usage
// private - for code of main (parent) class only $result = $this->get_card_type_icon_url( $card_type );
- $card_type(string) (required)
- Card type.
PaymentMethodIcons::get_card_type_icon_url() PaymentMethodIcons::get card type icon url code WC 10.3.6
private function get_card_type_icon_url( $card_type ) {
$assets_path = 'assets/images/payment-methods-cards/';
$icon_path = WC_ABSPATH . $assets_path . $card_type . '.svg';
$icon_url = \plugins_url( $assets_path . $card_type . '.svg', WC_PLUGIN_FILE );
return file_exists( $icon_path ) ? $icon_url : '';
}