woocommerce_get_cancel_order_url_raw хук-фильтрWC 2.2.0

Filter the raw URL to cancel the order in the frontend.

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

add_filter( 'woocommerce_get_cancel_order_url_raw', 'wp_kama_woocommerce_get_cancel_order_url_raw_filter', 10, 3 );

/**
 * Function for `woocommerce_get_cancel_order_url_raw` filter-hook.
 * 
 * @param string   $url      
 * @param WC_Order $order    Order data.
 * @param string   $redirect Redirect URL.
 *
 * @return string
 */
function wp_kama_woocommerce_get_cancel_order_url_raw_filter( $url, $order, $redirect ){

	// filter...
	return $url;
}
$url(строка)
-
$order(WC_Order)
Order data.
$redirect(строка)
Redirect URL.

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

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

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

WC_Order::get_cancel_order_url_raw()
woocommerce_get_cancel_order_url_raw
woocommerce/includes/class-wc-order.php 1865-1879
return apply_filters(
	'woocommerce_get_cancel_order_url_raw',
	add_query_arg(
		array(
			'cancel_order' => 'true',
			'order'        => $this->get_order_key(),
			'order_id'     => $this->get_id(),
			'redirect'     => $redirect,
			'_wpnonce'     => wp_create_nonce( 'woocommerce-cancel_order' ),
		),
		$this->get_cancel_endpoint()
	),
	$this,
	$redirect
);

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

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