woocommerce_payment_token_class filter-hookWC 3.8.0

Filter payment token class per type.

Usage

add_filter( 'woocommerce_payment_token_class', 'wp_kama_woocommerce_payment_token_class_filter', 10, 2 );

/**
 * Function for `woocommerce_payment_token_class` filter-hook.
 * 
 * @param string $class Payment token class.
 * @param string $type  Token type.
 *
 * @return string
 */
function wp_kama_woocommerce_payment_token_class_filter( $class, $type ){

	// filter...
	return $class;
}
$class(string)
Payment token class.
$type(string)
Token type.

Changelog

Since 3.8.0 Introduced.

Where the hook is called

WC_Payment_Tokens::get_token_classname()
woocommerce_payment_token_class
woocommerce/includes/class-wc-payment-tokens.php 240
return apply_filters( 'woocommerce_payment_token_class', 'WC_Payment_Token_' . $type, $type );

Where the hook is used in WooCommerce

Usage not found.