Action
rpress_add_discount_form_before_max_uses
Fires on the Add Discount form before the Max Uses row.
Runs while the Add New Discount form is being printed, inside the form table, before the Max Uses row. Output complete table rows (tr elements) so the markup stays valid. The action receives no arguments.
Example#
function my_discount_field_row() {
?>
<tr>
<th scope="row"><label for="my-discount-note"><?php esc_html_e( 'Internal note', 'my-plugin' ); ?></label></th>
<td><input type="text" id="my-discount-note" name="my_discount_note" class="regular-text" /></td>
</tr>
<?php
}
add_action( 'rpress_add_discount_form_before_max_uses', 'my_discount_field_row' );
Notes#
Printing a field does not save it. Save submitted values from rpress_post_insert_discount (add) or rpress_post_update_discount (edit).
Source#
Fired from:
includes/admin/discounts/add-discount.php(line 294)
See also#
Was this page helpful?
