Action
rpress_setup_discount
On this page
Fires after the RPRESS_Discount object is set up.
Fires at the end of RPRESS_Discount::setup_discount(), after all properties are populated and before the method returns true. Extensions can use it to load their own data onto the object.
Available since RestroPress 1.0.6.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$discount_object | RPRESS_Discount | The populated discount object. |
$discount | WP_Post | The discount post. |
Example#
function my_setup_discount( $discount_object, $discount ) {
$discount_object->my_note = get_post_meta( $discount->ID, '_my_discount_note', true );
}
add_action( 'rpress_setup_discount', 'my_setup_discount', 10, 2 );
Source#
Fired from:
includes/class-rpress-discount.php(line 429), inRPRESS_Discount::setup_discount()
See also#
Was this page helpful?
