woocommerce_thankyou_order_id
Filters the ID of the order shown on the thanks page.
Использование
add_filter( 'woocommerce_thankyou_order_id', 'wp_kama_woocommerce_thankyou_order_id_filter' );
/**
* Function for `woocommerce_thankyou_order_id` filter-hook.
*
* @param int $order_id The order ID resolved from the request.
*
* @return int
*/
function wp_kama_woocommerce_thankyou_order_id_filter( $order_id ){
// filter...
return $order_id;
}
- $order_id(int)
- The order ID resolved from the request.
Список изменений
| С версии 2.0.0 | Введена. |
Где вызывается хук
woocommerce_thankyou_order_id
woocommerce_thankyou_order_id
woocommerce/includes/shortcodes/class-wc-shortcode-checkout.php 274
$order_id = apply_filters( 'woocommerce_thankyou_order_id', absint( $order_id ) );
woocommerce/includes/gateways/paypal/includes/class-wc-gateway-paypal-pdt-handler.php 109
$order_id = apply_filters( 'woocommerce_thankyou_order_id', absint( $wp->query_vars['order-received'] ) );