Filter
rpress_allow_negative_prices
On this page
Filters whether negative prices are allowed when saving price meta.
Applied in RPRESS_Register_Meta::sanitize_price(), which sanitises the menu item price and each variable price amount. When it returns false, any price below zero is saved as 0.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$allow | bool | Whether negative prices are allowed, false by default. |
Return value#
bool. True to keep negative prices.
Example#
function my_allow_negative_prices( $allow ) {
return true;
}
add_filter( 'rpress_allow_negative_prices', 'my_allow_negative_prices' );
Source#
Applied in:
includes/class-rpress-register-meta.php(line 343), inRPRESS_Register_Meta::sanitize_price()
See also#
Was this page helpful?
