Skip to content
Docs
Get RestroPress

Filter

rpress_sanitize_amount

Updated
On this page

Filters the sanitized price amount before rpress_sanitize_amount returns it.

Runs at the end of rpress_sanitize_amount, after thousands separators have been removed, the decimal separator normalised to a dot and the value rounded with number_format. Negative amounts keep their sign.

Parameters#

ParameterTypeDescription
$amountstringThe sanitized price.

Return value#

string. The sanitized price.

Example#

function my_sanitize_amount( $amount ) {
	return $amount;
}
add_filter( 'rpress_sanitize_amount', 'my_sanitize_amount', 10, 1 );

Source#

Applied in:

  • includes/formatting.php (line 61), in rpress_sanitize_amount()

See also#

Was this page helpful?