woocommerce_thankyou_order_key │ хук-фильтр │ WC 2.0.0

Filters the order key used to validate the order shown on the thanks page.

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

add_filter( 'woocommerce_thankyou_order_key', 'wp_kama_woocommerce_thankyou_order_key_filter' );

/**
 * Function for `woocommerce_thankyou_order_key` filter-hook.
 * 
 * @param string $order_key The order key read from the request, or an empty string.
 *
 * @return string
 */
function wp_kama_woocommerce_thankyou_order_key_filter( $order_key ){
	// filter...
	return $order_key;
}
$order_key(строка)
The order key read from the request, or an empty string.

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

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

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

WC_Shortcode_Checkout::order_received()
woocommerce_thankyou_order_key
woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php 281
$order_key = apply_filters( 'woocommerce_thankyou_order_key', ( empty( $_GET['key'] ) || ! is_string( $_GET['key'] ) ) ? '' : sanitize_text_field( wp_unslash( $_GET['key'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Bearer-style order-key lookup; the value is compared with hash_equals() below and a nonce cannot apply to links emailed to the customer.

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

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