Skip to content
Docs
Get RestroPress

Action

rpress_purchase_link_top

Updated
On this page

Fires at the top of a menu item purchase form.

Runs inside the opening form tag of the purchase link, before the submit wrapper. A core callback on this hook prints the pricing schema microdata. Use it to output extra hidden inputs or markup.

Parameters#

ParameterTypeDescription
$fooditem_idintMenu item ID.
$argsarrayPurchase link arguments.

Example#

function my_purchase_link_top( $fooditem_id, $args ) {
	echo '<input type="hidden" name="my_source" value="menu">';
}
add_action( 'rpress_purchase_link_top', 'my_purchase_link_top', 10, 2 );

Notes#

Fires from both the list and grid purchase link builders.

Source#

Fired from:

  • includes/template-functions.php (line 182), in rpress_get_purchase_link()
  • includes/template-functions.php (line 322), in rpress_get_purchase_link_grid()

See also#

Was this page helpful?