Automattic\WooCommerce\Blocks\BlockTypes
PaymentMethodIcons::get_card_type_icon_url
Get the card type icon URL.
Метод класса: PaymentMethodIcons{}
Хуков нет.
Возвращает
Строку. Card type icon URL.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_card_type_icon_url( $card_type );
- $card_type(строка) (обязательный)
- Card type.
Код PaymentMethodIcons::get_card_type_icon_url() PaymentMethodIcons::get card type icon url WC 11.0.1
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 : '';
}