wc_get_credit_card_type_label دریافت نام مناسب برای ارائه دهنده کارت اعتباری

wc_get_credit_card_type_label دریافت نام مناسب برای ارائه دهنده کارت اعتباری

تابع ووکامرسی wc_get_credit_card_type_label – دریافت نام مناسب برای ارائه دهنده کارت اعتباری

Syntax – سینتکس

(string) wc_get_credit_card_type_label( (string) $type ); 

Parameters – پارامتر ها (1)

  • 1- $type (string)

Usage – نحوه استفاده

if ( !function_exists( 'wc_get_credit_card_type_label' ) ) { 
    require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-core-functions.php'; 
} 
  
// Provider Slug/Type 
$type = ''; 
  
// NOTICE! Understand what this does before running. 
$result = wc_get_credit_card_type_label($type); 
    

Defined – محل تعریف

/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( 'wocommerce_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 ) ) ); 
} 

versions – نسخه ها

از نسخه : 2.6.0

نسخه فعلی : 3.0.6

دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2

ارسال نظر

جهت استفاده از کد حتما از تگ pre استفاده نمایید .

contact us