Skip to content
Docs
Get RestroPress

Filter

rpress_success_page_redirect

Updated
On this page

Filters the URL customers are redirected to after a successful order.

Runs in rpress_send_to_success_page() just before wp_safe_redirect(). The URL is the success page with a payment_key query string unless a query string was supplied.

Parameters#

ParameterTypeDescription
$redirectstringRedirect URL.
$gatewaystringGateway ID from the rpress-gateway request value, or an empty string.
$query_stringstring|nullQuery string appended to the success page.

Return value#

string. The URL to redirect to.

Example#

function my_success_page_redirect( $redirect, $gateway, $query_string ) {
	return add_query_arg( 'gateway', $gateway, $redirect );
}
add_filter( 'rpress_success_page_redirect', 'my_success_page_redirect', 10, 3 );

Notes#

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

Source#

Applied in:

  • includes/checkout/functions.php (line 118), in rpress_send_to_success_page()

See also#

Was this page helpful?