Skip to content
Docs
Get RestroPress

Filter

rpress_cc_found_card_type

Updated
On this page

Filters the card type name detected for a card number.

Runs at the end of rpress_detect_cc_type(). The first value is the name of the first matching card type, or false if none matched. Return a different name or false to override the detection.

Parameters#

ParameterTypeDescription
$returnstring|falseMatched card type name, or false when no type matched.
$numberstringThe card number.
$card_typesarray[]The card type definitions that were used.

Return value#

string|false. The detected card type name, or false.

Example#

function my_cc_found_card_type( $return, $number, $card_types ) {
	if ( false === $return && 0 === strpos( $number, '9792' ) ) {
		return 'troy';
	}
	return $return;
}
add_filter( 'rpress_cc_found_card_type', 'my_cc_found_card_type', 10, 3 );

Source#

Applied in:

  • includes/checkout/functions.php (line 499), in rpress_detect_cc_type()

See also#

Was this page helpful?