Filter
rpress_remove_payment_prefix_postfix
On this page
Filters the order number after its prefix and postfix are removed.
Runs at the end of rpress_remove_payment_prefix_postfix(). The function strips the configured prefix and postfix from a formatted order number and converts the rest to an integer. It is used when the next sequential number is recalculated from the last stored order.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$number | int | The integer order number. |
$prefix | string | The configured prefix. |
$postfix | string | The configured postfix. |
Return value#
int. The unprefixed order number.
Example#
add_filter( 'rpress_remove_payment_prefix_postfix', 'my_cap_unprefixed_number', 10, 3 );
function my_cap_unprefixed_number( $number, $prefix, $postfix ) {
return max( 0, (int) $number );
}
Notes#
Padding added in rpress_format_payment_number can be stripped by the integer conversion.
Source#
Applied in:
includes/payments/functions.php(line 1510), inrpress_remove_payment_prefix_postfix()
See also#
Was this page helpful?
