Automattic\WooCommerce\Internal\Admin\WCPayPromotion

DefaultPromotions::get_wcpay_payment_icons()private staticWC 1.0

Get the list of payment icons as HTML img tags.

Метод класса: DefaultPromotions{}

Хуков нет.

Возвращает

Строку. Payment icons as HTML img tags.

Использование

$result = DefaultPromotions::get_wcpay_payment_icons(): string;

Код DefaultPromotions::get_wcpay_payment_icons() WC 9.3.3

private static function get_wcpay_payment_icons(): string {
	$icons              = array(
		'visa',
		'mastercard',
		'amex',
		'googlepay',
		'applepay',
	);
	$convert_to_img_tag = function ( $icon ) {
		return sprintf(
			'<img class="wcpay-%s-icon wcpay-icon" src="%s" alt="%s">',
			$icon,
			plugins_url( "assets/images/payment-methods/$icon.svg", WC_PLUGIN_FILE ),
			ucfirst( $icon )
		);
	};

	return implode( '', array_map( $convert_to_img_tag, $icons ) );
}