Skip to content
Docs
Get RestroPress

Filter

rpress_send_back_to_checkout

Updated
On this page

Filters the URL used to send a customer back to the checkout.

Runs in rpress_send_back_to_checkout() just before wp_safe_redirect(), for example after a validation error. The URL is the checkout URL with the supplied arguments appended.

Parameters#

ParameterTypeDescription
$redirectstringRedirect URL.
$argsarrayQuery arguments added to the URL (strings are parsed into an array).

Return value#

string. The URL to redirect to.

Example#

function my_send_back_to_checkout( $redirect, $args ) {
	return add_query_arg( 'retry', '1', $redirect );
}
add_filter( 'rpress_send_back_to_checkout', 'my_send_back_to_checkout', 10, 2 );

Notes#

wp_safe_redirect() only allows hosts permitted by the allowed_redirect_hosts filter.

Source#

Applied in:

  • includes/checkout/functions.php (line 167), in rpress_send_back_to_checkout()

See also#

Was this page helpful?