Skip to content
Docs
Get RestroPress

Filter

rpress_increment_payment_number

Updated
On this page

Filters whether the next sequential order number should be incremented.

Runs in rpress_get_next_payment_number() after the last used number has been read. When the filtered value is truthy, the number is incremented by one before it is returned. The default is true, except when the sequence is only starting and the configured starting number is used as is.

Parameters#

ParameterTypeDescription
$increment_numberboolWhether to add one to the number.
$numberint|stringThe last used order number (or the starting number).

Return value#

bool. True to increment the number.

Example#

add_filter( 'rpress_increment_payment_number', 'my_keep_payment_number', 10, 2 );
function my_keep_payment_number( $increment_number, $number ) {
	if ( 100 === (int) $number ) {
		return false;
	}
	return $increment_number;
}

Source#

Applied in:

  • includes/payments/functions.php (line 1483), in rpress_get_next_payment_number()

See also#

Was this page helpful?