Filter
rpress_cc_is_valid_format
On this page
Filters the final result of the card number format validation.
Runs at the end of rpress_validate_card_number_format(), after the Luhn check and the card type lookup. The value is true only if the number passed both. Return false to reject a number the plugin accepted, or true to accept one it rejected.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$is_valid_format | bool | Whether the number passed the Luhn check and matched a known card type. |
$number | string | The card number being validated. |
Return value#
bool. True if the card number format is valid.
Example#
function my_cc_is_valid_format( $is_valid_format, $number ) {
return $is_valid_format && strlen( $number ) >= 13;
}
add_filter( 'rpress_cc_is_valid_format', 'my_cc_is_valid_format', 10, 2 );
Source#
Applied in:
includes/checkout/functions.php(line 391), inrpress_validate_card_number_format()
See also#
Was this page helpful?
