Filter
rpress_fooditem_redirect_to_checkout
On this page
Filters whether adding the item redirects to checkout.
Runs in the purchase form. The default is the result of rpress_straight_to_checkout(). When true, a hidden rpress_redirect_to_checkout input is added to the form.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$redirect | bool | Whether to redirect straight to checkout. |
$fooditem_id | int | Menu item ID. |
$args | array | Purchase link arguments. |
Return value#
bool. True to add the redirect-to-checkout input.
Example#
function my_redirect_to_checkout( $redirect, $fooditem_id, $args ) {
return ! empty( $args['direct'] ) ? true : $redirect;
}
add_filter( 'rpress_fooditem_redirect_to_checkout', 'my_redirect_to_checkout', 10, 3 );
Notes#
Fires from both the list and grid purchase link builders.
Source#
Applied in:
includes/template-functions.php(line 220), inrpress_get_purchase_link()includes/template-functions.php(line 363), inrpress_get_purchase_link_grid()
See also#
Was this page helpful?
