Skip to content
Docs
Get RestroPress

Filter

rpress_is_discount_started

Updated
On this page

Filters whether a discount has started.

Runs at the end of RPRESS_Discount::is_started() with the computed result. A discount with no start date is treated as started. When the date is in the future, a checkout error may have been set before this filter runs. Returning a different value changes whether the discount is accepted at checkout.

Available since RestroPress 1.0.6.

Parameters#

ParameterTypeDescription
$returnboolWhether the discount has started.
$discount_idintThe discount ID.

Return value#

bool. Whether the discount has started.

Example#

function my_rpress_is_discount_started( $return, $discount_id ) {
	return $return;
}
add_filter( 'rpress_is_discount_started', 'my_rpress_is_discount_started', 10, 2 );

Source#

Applied in:

  • includes/class-rpress-discount.php (line 1400), in RPRESS_Discount::is_started()
Was this page helpful?