Skip to content
Docs
Get RestroPress

Action

rpress_add_discount_form_before_products

Updated
On this page

Fires on the Add Discount form before the menu item requirements row.

Runs while the Add New Discount form is being printed, inside the form table, before the menu item requirements 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_products', '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 81)

See also#

Was this page helpful?