Automattic\WooCommerce\Internal\Admin\WCPayPromotion

DefaultPromotions::get_wcpay_payment_iconsprivate staticWC 1.0

Get the list of payment icons as HTML img tags.

Method of the class: DefaultPromotions{}

No Hooks.

Returns

String. Payment icons as HTML img tags.

Usage

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

DefaultPromotions::get_wcpay_payment_icons() code WC 9.9.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 ) );
}