woocommerce_customer_get_last_order хук-фильтрWC 4.9.1

Filters the id of the last order from a given customer.

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

add_filter( 'woocommerce_customer_get_last_order', 'wp_kama_woocommerce_customer_get_last_order_filter', 10, 2 );

/**
 * Function for `woocommerce_customer_get_last_order` filter-hook.
 * 
 * @param string      $last_order_id The last order id as retrieved from the database.
 * @param WC_Customer $customer      The customer whose last order id is being retrieved.
 *
 * @return string
 */
function wp_kama_woocommerce_customer_get_last_order_filter( $last_order_id, $customer ){

	// filter...
	return $last_order_id;
}
$last_order_id(строка)
The last order id as retrieved from the database.
$customer(WC_Customer)
The customer whose last order id is being retrieved.

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

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

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

WC_Customer_Data_Store::get_last_order()
woocommerce_customer_get_last_order
woocommerce/includes/data-stores/class-wc-customer-data-store.php 371-375
$last_order_id = apply_filters(
	'woocommerce_customer_get_last_order',
	$last_order_id,
	$customer
);

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

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