Filter
rpress_cc_found_card_type
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#
| Parameter | Type | Description |
|---|---|---|
$return | string|false | Matched card type name, or false when no type matched. |
$number | string | The card number. |
$card_types | array[] | 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 505), inrpress_detect_cc_type()
See also#
Was this page helpful?
