Action
rpress_pre_setup_discount
On this page
Fires before the RPRESS_Discount object is set up.
Fires in RPRESS_Discount::setup_discount() before the object properties are populated from the WP_Post and its meta. Both arguments are available, but the discount object itself is still empty.
Available since RestroPress 1.0.6.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$discount_object | RPRESS_Discount | The discount object being set up. |
$discount | WP_Post | The discount post. |
Example#
function my_pre_setup_discount( $discount_object, $discount ) {
error_log( 'Setting up discount ' . $discount->ID );
}
add_action( 'rpress_pre_setup_discount', 'my_pre_setup_discount', 10, 2 );
Source#
Fired from:
includes/class-rpress-discount.php(line 393), inRPRESS_Discount::setup_discount()
See also#
Was this page helpful?
