woocommerce_checkout_customer_id хук-фильтрWC 3.0.0

Provides an opportunity to modify the customer ID associated with the current checkout process.

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

add_filter( 'woocommerce_checkout_customer_id', 'wp_kama_woocommerce_checkout_customer_id_filter' );

/**
 * Function for `woocommerce_checkout_customer_id` filter-hook.
 * 
 * @param int $current_user_id The current user's ID (this may be 0 if no user is logged in).
 *
 * @return int
 */
function wp_kama_woocommerce_checkout_customer_id_filter( $current_user_id ){

	// filter...
	return $current_user_id;
}
$current_user_id(int)
The current user's ID (this may be 0 if no user is logged in).

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

С версии 3.0.0 Введена.
С версии 3.0.0 or earlier

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

WC_Checkout::__get()
woocommerce_checkout_customer_id
WC_Checkout::create_order()
woocommerce_checkout_customer_id
WC_Checkout::process_customer()
woocommerce_checkout_customer_id
woocommerce/includes/class-wc-checkout.php 168
return apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() );
woocommerce/includes/class-wc-checkout.php 435
$order->set_customer_id( apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() ) );
woocommerce/includes/class-wc-checkout.php 1118
$customer_id = apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() );

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

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