wc_get_credit_card_type_label( string $type )
Get a nice name for credit card providers.
Description Description
Parameters Parameters
- $type
-
(Required) Provider Slug/Type.
Return Return
(string)
Source Source
File: includes/wc-core-functions.php
function wc_get_credit_card_type_label( $type ) {
// Normalize.
$type = strtolower( $type );
$type = str_replace( '-', ' ', $type );
$type = str_replace( '_', ' ', $type );
$labels = apply_filters(
'woocommerce_credit_card_type_labels',
array(
'mastercard' => __( 'MasterCard', 'woocommerce' ),
'visa' => __( 'Visa', 'woocommerce' ),
'discover' => __( 'Discover', 'woocommerce' ),
'american express' => __( 'American Express', 'woocommerce' ),
'diners' => __( 'Diners', 'woocommerce' ),
'jcb' => __( 'JCB', 'woocommerce' ),
)
);
return apply_filters( 'woocommerce_get_credit_card_type_label', ( array_key_exists( $type, $labels ) ? $labels[ $type ] : ucfirst( $type ) ) );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |