woocommerce_redirect_order_location
Filter the URL used to redirect after an order is updated. Similar to the WP post's redirect_post_location
Usage
add_filter( 'woocommerce_redirect_order_location', 'wp_kama_woocommerce_redirect_order_location_filter', 10, 3 ); /** * Function for `woocommerce_redirect_order_location` filter-hook. * * @param string $redirect_to The redirect destination URL. * @param int $order_id The order ID. * @param \WC_Order $order The order object. * * @return string */ function wp_kama_woocommerce_redirect_order_location_filter( $redirect_to, $order_id, $order ){ // filter... return $redirect_to; }
- $redirect_to(string)
- The redirect destination URL.
- $order_id(int)
- The order ID.
- $order(\WC_Order)
- The order object.
Changelog
Since 8.0.0 | Introduced. |
Where the hook is called
woocommerce_redirect_order_location
woocommerce/src/Internal/Admin/Orders/Edit.php 349-354
apply_filters( 'woocommerce_redirect_order_location', $redirect_to, $order->get_id(), $order )