woocommerce_redirect_order_location хук-фильтрWC 8.0.0

Filter the URL used to redirect after an order is updated. Similar to the WP post's redirect_post_location

Использование

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(строка)
The redirect destination URL.
$order_id(int)
The order ID.
$order(\WC_Order)
The order object.

Список изменений

С версии 8.0.0 Введена.

Где вызывается хук

Edit::redirect_order()
woocommerce_redirect_order_location
woocommerce/src/Internal/Admin/Orders/Edit.php 354-359
apply_filters(
	'woocommerce_redirect_order_location',
	$redirect_to,
	$order->get_id(),
	$order
)

Где используется хук в WooCommerce

Использование не найдено.