Action
rpress_edit_discount_form_bottom
On this page
Fires at the bottom of the Edit Discount form, after the form table.
Runs after the closing table tag of the Edit Discount screen and before the submit button. Use it to print additional fields or help text for the discount being edited.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$discount_id | int | The discount ID being edited. |
$discount | RPRESS_Discount|false | The discount object loaded with rpress_get_discount(); false when the discount was not found. |
Example#
function my_edit_discount_form_bottom( $discount_id, $discount ) {
if ( $discount ) {
echo '<p class="description">' . esc_html( sprintf( 'Code: %s', $discount->code ) ) . '</p>';
}
}
add_action( 'rpress_edit_discount_form_bottom', 'my_edit_discount_form_bottom', 10, 2 );
Notes#
Printing a field does not save it. Save submitted values from rpress_post_update_discount.
Source#
Fired from:
includes/admin/discounts/edit-discount.php(line 340)
See also#
Was this page helpful?
