Skip to content
Docs
Get RestroPress

Filter

rpress_remove_payment_prefix_postfix

Updated
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#

ParameterTypeDescription
$numberintThe integer order number.
$prefixstringThe configured prefix.
$postfixstringThe 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), in rpress_remove_payment_prefix_postfix()

See also#

Was this page helpful?